Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fixes #3 * Add tests, and test runner * Add failing test * Add flowconfig * Fix #3: Fails for `en` and videoId `JueUvj6X3DA`
- Loading branch information
Showing
5 changed files
with
1,250 additions
and
37 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
[ignore] | ||
|
||
[include] | ||
|
||
[libs] | ||
|
||
[lints] | ||
|
||
[options] | ||
|
||
[strict] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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,'); | ||
}); |
Oops, something went wrong.