Skip to content

Commit 9384fa2

Browse files
committed
add test setup
1 parent 7a2e008 commit 9384fa2

1 file changed

Lines changed: 14 additions & 0 deletions

File tree

test-setup.ts

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,4 +14,18 @@ if (!Element.prototype.scrollTo) {
1414
(Element.prototype as any).scrollTo = function () {};
1515
}
1616

17+
if (!URL.createObjectURL) {
18+
let counter = 0;
19+
const objectURLs = new Map<string, string>();
20+
(URL as any).createObjectURL = function (blob: Blob): string {
21+
const id = `blob:${++counter}`;
22+
const url = `blob:${id}`;
23+
objectURLs.set(url, blob as any);
24+
return url;
25+
};
26+
(URL as any).revokeObjectURL = function (url: string): void {
27+
objectURLs.delete(url);
28+
};
29+
}
30+
1731
setupTestBed();

0 commit comments

Comments
 (0)