switch out weather library
All checks were successful
NPM Audit Check / Check NPM audit (push) Successful in -2m17s
Unit tests / Unit tests (push) Successful in -2m10s

This commit is contained in:
2025-08-29 01:37:02 -05:00
parent 527de38044
commit 8f8819276f
7 changed files with 120 additions and 507 deletions

43
test/sequencer.test.ts Normal file
View File

@@ -0,0 +1,43 @@
import { describe, expect, it, vi, beforeEach } from 'vitest';
import { type CurrentWeather, type Options } from 'openweather-api-node';
import { Sequencer } from '../src/sequencer.js';
import type { Config } from '../src/index.js';
const dummyWeather: Options = { key: 'dummy' };
vi.mock('openweather-api-node', () => {
return {
OpenWeatherAPI: vi.fn().mockImplementation((_) => {
return {
getCurrent: vi.fn(() => {})
}
})
}
});
describe('sequencer', () => {
it('can generate a list from a static config', async () => {
expect(await Sequencer({
programs: [['sequence 1', 'segment 1', 'segment 2']],
segments: {
'segment 1': ['sequence 1'],
'segment 2': ['sequence 2']
},
sequences: {
'sequence 1': {
'tracks': [
'seq1.flac'
]
},
'sequence 2': {
'tracks': [
'seq2.flac'
]
}
},
voices: {},
weather: dummyWeather
})).to.include.ordered.members(['seq1.flac', 'seq1.flac', 'seq2.flac']);
});
});