2022-12-01 17:58:08 +03:00
|
|
|
// jest-dom adds custom jest matchers for asserting on DOM nodes.
|
|
|
|
// allows you to do things like:
|
|
|
|
// expect(element).toHaveTextContent(/react/i)
|
|
|
|
// learn more: https://github.com/testing-library/jest-dom
|
|
|
|
import '@testing-library/jest-dom';
|
2024-08-30 16:51:36 +03:00
|
|
|
|
|
|
|
/**
|
|
|
|
* The structuredClone global function is not available in jsdom, it needs to be mocked for now.
|
|
|
|
*
|
|
|
|
* The most naive way to mock structuredClone is to use JSON.stringify and JSON.parse. This works
|
|
|
|
* for arguments with simple types like primitives, arrays and objects, but doesn't work with functions,
|
|
|
|
* Map, Set, etc.
|
|
|
|
*/
|
|
|
|
global.structuredClone = (val) => {
|
|
|
|
return JSON.parse(JSON.stringify(val));
|
|
|
|
};
|