Use source loader for email sprite icons
[ProtonMail-WebClient.git] / packages / activation / jest.setup.js
blob7835f28c0f8431fc4cbfa71bcaa328fa614e1ce2
1 import '@testing-library/jest-dom';
2 import 'whatwg-fetch';
4 import '@proton/testing/lib/mockMatchMedia';
5 import '@proton/testing/lib/mockUnleash';
7 import ResizeObserver from './src/tests/mock/ResizeObserver';
9 // Silence warnings on expect to throw https://github.com/testing-library/react-testing-library/issues/157
10 console.error = () => {};
11 console.warn = () => {};
13 beforeAll(() => {
14     window.ResizeObserver = ResizeObserver;
15 });
17 // Do not start crypto worker pool, let the single tests setup/mock the CryptoProxy as needed
18 jest.mock('@proton/shared/lib/helpers/setupCryptoWorker', () => ({
19     __esModule: true,
20     loadCryptoWorker: jest.fn(),
21 }));
23 // Silence JDOM warnings triggered by emoji-mart
24 HTMLCanvasElement.prototype.getContext = jest.fn();
26 jest.mock('@proton/shared/lib/i18n/dateFnLocales', () => ({
27     __esModule: true,
28 }));
30 jest.mock('@proton/shared/lib/pow/wasmWorkerWrapper.ts', () => ({
31     __esModule: true,
32 }));
34 jest.mock('@proton/shared/lib/pow/pbkdfWorkerWrapper.ts', () => ({
35     __esModule: true,
36 }));