-
-
Notifications
You must be signed in to change notification settings - Fork 54
Expand file tree
/
Copy pathjest.setup.js
More file actions
23 lines (18 loc) · 722 Bytes
/
jest.setup.js
File metadata and controls
23 lines (18 loc) · 722 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
/* global jest */
// Add any global setup for Jest tests here
import 'core-js/stable';
// Setup Intl polyfill
global.IntlPolyfill = require('intl');
require('intl/locale-data/jsonp/en.js');
require('intl-pluralrules');
// Setup Jest DOM matchers
require('@testing-library/jest-dom');
// Define global variables that might be expected in tests
global.__DEV__ = false;
global.__TEST__ = true;
global.__PROD__ = false;
global.__I18N_ENABLED__ = 'false';
global.__DEV_TOOLS__ = false;
// Prevent computing of styles for faster test execution
// https://web.archive.org/web/20250216081109/https://www.helpscout.com/blog/improve-react-testing-times/
window.getComputedStyle = () => ({ getPropertyValue: () => undefined });