Skip to content

Commit

Permalink
Merge pull request #121 from radiovisual/fix-loom-export
Browse files Browse the repository at this point in the history
fix: export loom package in build
  • Loading branch information
radiovisual authored Jun 24, 2024
2 parents b1b4236 + 924ce8f commit 63186b5
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 1 deletion.
7 changes: 7 additions & 0 deletions __tests__/builds/cjs-module.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -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');
});
});
9 changes: 8 additions & 1 deletion __tests__/builds/es-module.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -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');
});
});
7 changes: 7 additions & 0 deletions __tests__/builds/umd-module.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -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');
});
});

0 comments on commit 63186b5

Please sign in to comment.