-
Notifications
You must be signed in to change notification settings - Fork 40
/
jest.config.js
36 lines (36 loc) · 1.08 KB
/
jest.config.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
module.exports = {
clearMocks: false,
moduleFileExtensions: [
'web.js',
'js',
'web.ts',
'ts',
'web.tsx',
'tsx',
'json',
'web.jsx',
'jsx',
'node',
],
moduleNameMapper: {
'^.+\\.module\\.(css|sass|scss)$': 'identity-obj-proxy',
'^msw-storybook-addon$': '<rootDir>/../msw-addon/dist/index.node.js',
// Temporary workaround for a Storybook issue
'^@storybook/react-dom-shim$': '<rootDir>/../../node_modules/@storybook/react-dom-shim/dist/react-16.js',
},
resetMocks: true,
resetModules: false,
restoreMocks: false,
setupFiles: ['./src/fetch-polyfill.js'],
setupFilesAfterEnv: ['./src/setupTests.js'],
testEnvironment: 'jsdom',
testEnvironmentOptions: {
customExportConditions: [''],
},
transform: {
'^.+\\.(js|jsx|mjs|cjs|ts|tsx)$': 'react-scripts/config/jest/babelTransform.js',
'^.+\\.css$': 'react-scripts/config/jest/cssTransform.js',
'^(?!.*\\.(js|jsx|mjs|cjs|ts|tsx|css|json)$)': 'react-scripts/config/jest/fileTransform.js',
},
transformIgnorePatterns: ['node_modules/(?!@bundled-es-modules)/'],
}