Skip to content

Commit 1555b06

Browse files
committed
test: provide structuredClone implementation to jest
1 parent 479279b commit 1555b06

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

jest.env.setup.js

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,12 @@ Object.defineProperty(globalThis, 'crypto', {
1212
},
1313
});
1414

15+
Object.defineProperty(globalThis, 'structuredClone', {
16+
value: (val) => {
17+
return JSON.parse(JSON.stringify(val));
18+
},
19+
});
20+
1521
// Mock proper File API behavior
1622
if (typeof File === 'undefined') {
1723
class File extends Blob {

0 commit comments

Comments
 (0)