switch out weather library
This commit is contained in:
43
test/sequencer.test.ts
Normal file
43
test/sequencer.test.ts
Normal 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']);
|
||||
});
|
||||
});
|
||||
|
Reference in New Issue
Block a user