Skip to content

Commit

Permalink
test blob urls
Browse files Browse the repository at this point in the history
  • Loading branch information
guybedford committed Oct 28, 2024
1 parent 1369428 commit 03d205b
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 0 deletions.
5 changes: 5 additions & 0 deletions test/fixtures/load-blob.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
export async function loadBlob () {
const blob = new Blob(['export var p = 5'], { type: 'text/javascript' });
const blobUrl = URL.createObjectURL(blob);
return await import(blobUrl);
}
6 changes: 6 additions & 0 deletions test/shim.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,12 @@ suite('Basic loading tests', () => {
assert.equal(window.readyStateOrder.join(','), '1,2,3,4,5');
});

test('Should support blob urls', async function () {
const { loadBlob } = await importShim('./fixtures/load-blob.js');
const { p } = await loadBlob();
assert.equal(p, 5);
});

test('Load counter', function () {
assert.equal(count, 2);
});
Expand Down

0 comments on commit 03d205b

Please sign in to comment.