fixes #3 * Add tests, and test runner * Add failing test * Add flowconfig * Fix #3: Fails for `en` and videoId `JueUvj6X3DA`
17 lines
482 B
JavaScript
17 lines
482 B
JavaScript
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,');
|
|
});
|