Files
twenty/packages/twenty-front/setupTests.ts
Paul Rastoin 3c9bf2294f test(front): fix main failing test due to timezone (#11295)
# Introduction
Due to winter to summer timezone update, it shown that we have some unit
tests flakiness due to both mocked and unmocked date.now invokation
between app bootstrap and test bootstrap

This PR does not refactor this behavior
Just fix the currently failing test

## Note
Removed a duplicated file
2025-03-31 15:39:05 +02:00

16 lines
651 B
TypeScript

// 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';
/**
* 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));
};