From 924ce8fa8f9cb08eaa6f7a1c5252d408b0b31855 Mon Sep 17 00:00:00 2001 From: Michael Wuergler Date: Mon, 24 Jun 2024 21:40:44 +0200 Subject: [PATCH] fix: export loom package in build --- __tests__/builds/cjs-module.test.js | 7 +++++++ __tests__/builds/es-module.test.js | 9 ++++++++- __tests__/builds/umd-module.test.js | 7 +++++++ 3 files changed, 22 insertions(+), 1 deletion(-) 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'); }); });