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:
syzer
2018-08-31 15:25:45 +02:00
committed by Haroen Viaene
parent e344fdd5f6
commit de7581ac7b
5 changed files with 1247 additions and 34 deletions

16
test/index.test.js Normal file
View 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,');
});