Fix: Fix fails for some Id's (#4)
fixes #3 * Add tests, and test runner * Add failing test * Add flowconfig * Fix #3: Fails for `en` and videoId `JueUvj6X3DA`
This commit is contained in:
16
test/index.test.js
Normal file
16
test/index.test.js
Normal file
@@ -0,0 +1,16 @@
|
||||
import test from 'ava';
|
||||
import { getSubtitles } from '../src';
|
||||
|
||||
test('Extract estonia war subtitles', async t => {
|
||||
const subtitles = await getSubtitles({ videoID: 'HBA0xDHZjko' });
|
||||
t.deepEqual(subtitles[0], {
|
||||
dur: '5.87',
|
||||
start: '6.62',
|
||||
text: 'November 19',
|
||||
});
|
||||
});
|
||||
|
||||
test('Extract passive income video', async t => {
|
||||
const subtitles = await getSubtitles({ videoID: 'JueUvj6X3DA' });
|
||||
t.deepEqual(subtitles[0].text, '- Creating passive income takes work,');
|
||||
});
|
||||
Reference in New Issue
Block a user