diff --git a/__tests__/builds/cjs-module.test.js b/__tests__/builds/cjs-module.test.js index c319675..3005805 100644 --- a/__tests__/builds/cjs-module.test.js +++ b/__tests__/builds/cjs-module.test.js @@ -6,5 +6,12 @@ describe('bundled CJS module', () => { test('has the expected API', () => { expect(typeof getVideoId).toBe('function'); expect(getVideoId('https://www.youtube.com/watch?v=1234').id).toBe('1234'); + expect(getVideoId('https://www.loom.com/share/1234').id).toBe('1234'); + expect(getVideoId('http://www.dailymotion.com/video/dailymotionid_foo_bar').id).toBe('dailymotionid'); + expect(getVideoId('https://web.microsoftstream.com/video/foo').id).toBe('foo'); + expect(getVideoId('https://www.tiktok.com/@example/video/1100000000000000000').id).toBe('1100000000000000000'); + expect(getVideoId('https://videopress.com/v/12345678').id).toBe('12345678'); + expect(getVideoId('https://player.vimeo.com/video/123450987').id).toBe('123450987'); + expect(getVideoId('https://vine.co/v/vineid').id).toBe('vineid'); }); }); diff --git a/__tests__/builds/es-module.test.js b/__tests__/builds/es-module.test.js index e04df81..b7af851 100644 --- a/__tests__/builds/es-module.test.js +++ b/__tests__/builds/es-module.test.js @@ -3,7 +3,14 @@ import getVideoId from '../../dist/get-video-id.esm.js'; describe('bundled ES module', () => { test('has the expected API', () => { - expect(getVideoId).toBeInstanceOf(Function); + expect(typeof getVideoId).toBe('function'); expect(getVideoId('https://www.youtube.com/watch?v=1234').id).toBe('1234'); + expect(getVideoId('https://www.loom.com/share/1234').id).toBe('1234'); + expect(getVideoId('http://www.dailymotion.com/video/dailymotionid_foo_bar').id).toBe('dailymotionid'); + expect(getVideoId('https://web.microsoftstream.com/video/foo').id).toBe('foo'); + expect(getVideoId('https://www.tiktok.com/@example/video/1100000000000000000').id).toBe('1100000000000000000'); + expect(getVideoId('https://videopress.com/v/12345678').id).toBe('12345678'); + expect(getVideoId('https://player.vimeo.com/video/123450987').id).toBe('123450987'); + expect(getVideoId('https://vine.co/v/vineid').id).toBe('vineid'); }); }); diff --git a/__tests__/builds/umd-module.test.js b/__tests__/builds/umd-module.test.js index d09322d..bdbc820 100644 --- a/__tests__/builds/umd-module.test.js +++ b/__tests__/builds/umd-module.test.js @@ -6,5 +6,12 @@ describe('bundled umd module', () => { test('has the expected API', () => { expect(typeof getVideoId).toBe('function'); expect(getVideoId('https://www.youtube.com/watch?v=1234').id).toBe('1234'); + expect(getVideoId('https://www.loom.com/share/1234').id).toBe('1234'); + expect(getVideoId('http://www.dailymotion.com/video/dailymotionid_foo_bar').id).toBe('dailymotionid'); + expect(getVideoId('https://web.microsoftstream.com/video/foo').id).toBe('foo'); + expect(getVideoId('https://www.tiktok.com/@example/video/1100000000000000000').id).toBe('1100000000000000000'); + expect(getVideoId('https://videopress.com/v/12345678').id).toBe('12345678'); + expect(getVideoId('https://player.vimeo.com/video/123450987').id).toBe('123450987'); + expect(getVideoId('https://vine.co/v/vineid').id).toBe('vineid'); }); });