1
1
mirror of https://github.com/leon-ai/leon.git synced 2024-12-26 10:14:57 +03:00
leon/packages/videodownloader/test/youtube.spec.js

18 lines
551 B
JavaScript
Raw Normal View History

2019-02-10 15:26:50 +03:00
describe('videodownloader:youtube', async () => {
test('requests YouTube', async () => {
global.nlu.brain.execute = jest.fn()
await global.nlu.process('Download new videos from YouTube')
2019-02-10 15:26:50 +03:00
const [obj] = global.nlu.brain.execute.mock.calls
await global.brain.execute(obj[0])
expect(global.brain.interOutput.codes).toIncludeSameMembers(['reaching_playlist'])
expect([
2019-02-10 15:26:50 +03:00
'settings_error',
'request_error',
'nothing_to_download',
'success'
]).toIncludeAnyMembers(global.brain.finalOutput.codes)
2019-02-10 15:26:50 +03:00
})
})