mirror of
https://github.com/omnivore-app/omnivore.git
synced 2026-03-11 08:54:26 +00:00
Add tests
This commit is contained in:
parent
31eb1a0f61
commit
1f0abbaa30
1 changed files with 12 additions and 0 deletions
12
packages/puppeteer-parse/test/youtube-handler.test.js
Normal file
12
packages/puppeteer-parse/test/youtube-handler.test.js
Normal file
|
|
@ -0,0 +1,12 @@
|
|||
const { expect } = require('chai')
|
||||
const { getYoutubeVideoId } = require('../youtube-handler')
|
||||
|
||||
describe('getYoutubeVideoId', () => {
|
||||
it('should parse video id out of a URL', async () => {
|
||||
expect('BnSUk0je6oo').to.eq(getYoutubeVideoId('https://www.youtube.com/watch?v=BnSUk0je6oo&t=269s'));
|
||||
expect('vFD2gu007dc').to.eq(getYoutubeVideoId('https://www.youtube.com/watch?v=vFD2gu007dc&list=RDvFD2gu007dc&start_radio=1'));
|
||||
expect('vFD2gu007dc').to.eq(getYoutubeVideoId('https://youtu.be/vFD2gu007dc'));
|
||||
expect('BMFVCnbRaV4').to.eq(getYoutubeVideoId('https://youtube.com/watch?v=BMFVCnbRaV4&feature=share'));
|
||||
expect('cg9b4RC87LI').to.eq(getYoutubeVideoId('https://youtu.be/cg9b4RC87LI?t=116'));
|
||||
})
|
||||
})
|
||||
Loading…
Reference in a new issue