We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 5ac1170 commit 82c65d4Copy full SHA for 82c65d4
test/spec/utils/shim.spec.ts
@@ -0,0 +1,24 @@
1
+import atob from 'atob';
2
+
3
+test('#01: Shim overwrites undefined global atob', async () => {
4
+ globalThis.atob = undefined;
5
6
+ expect(globalThis.atob).toBeUndefined();
7
8
+ // eslint-disable-next-line global-require
9
+ require('../../../src/utils/shim');
10
11
+ expect(globalThis.atob).toBe(atob);
12
+});
13
14
+test('#02: Shim does not overwrite exisiting atob', async () => {
15
+ const dummyFunc = () => '';
16
+ globalThis.atob = dummyFunc;
17
18
+ expect(globalThis.atob).toBe(dummyFunc);
19
20
21
22
23
24
0 commit comments