2022-02-18 09:51:10 +01:00
|
|
|
import '@testing-library/jest-dom';
|
2022-05-05 17:15:22 +02:00
|
|
|
import 'whatwg-fetch';
|
2022-05-25 11:12:53 +02:00
|
|
|
import 'regenerator-runtime';
|
2024-09-25 12:56:09 +02:00
|
|
|
import { beforeAll, vi } from 'vitest';
|
2018-02-16 20:45:05 +01:00
|
|
|
|
2023-10-19 16:50:37 +02:00
|
|
|
class ResizeObserver {
|
|
|
|
observe() {}
|
|
|
|
unobserve() {}
|
|
|
|
disconnect() {}
|
|
|
|
}
|
|
|
|
|
|
|
|
if (!window.ResizeObserver) {
|
|
|
|
window.ResizeObserver = ResizeObserver;
|
|
|
|
}
|
|
|
|
|
2019-10-09 19:58:49 +02:00
|
|
|
process.env.TZ = 'UTC';
|
2024-09-25 12:56:09 +02:00
|
|
|
|
|
|
|
// ignore known React warnings
|
|
|
|
const consoleError = console.error;
|
|
|
|
beforeAll(() => {
|
|
|
|
vi.spyOn(console, 'error').mockImplementation((...args) => {
|
|
|
|
if (
|
|
|
|
!(
|
|
|
|
typeof args[0] === 'string' &&
|
|
|
|
args[0].includes(
|
|
|
|
'Warning: An update to %s inside a test was not wrapped in act',
|
|
|
|
)
|
|
|
|
)
|
|
|
|
) {
|
|
|
|
consoleError(...args);
|
|
|
|
}
|
|
|
|
});
|
|
|
|
});
|