-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathjest.config.js
More file actions
29 lines (22 loc) · 925 Bytes
/
jest.config.js
File metadata and controls
29 lines (22 loc) · 925 Bytes
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
module.exports = {
// Documentation and internet knowledge on TypeScript + Redux + Jest is so low that I had to set all this myself
preset: 'ts-jest/presets/js-with-ts',
// Runs special logic, such as cleaning up components
// when using React Testing Library and adds special
// extended assertions to Jest
setupFilesAfterEnv: ['@testing-library/jest-dom/extend-expect'],
// Test spec file resolution pattern
// Matches parent folder `__tests__` and filename
// should contain `test` or `spec`.
testRegex: '(/__tests__/.*|(\\.|/)(test|spec))\\.tsx?$',
// Module file extensions for importing
moduleFileExtensions: ['ts', 'tsx', 'js', 'jsx', 'json', 'node'],
verbose: true,
globals: {
NODE_ENV: 'test',
},
moduleNameMapper: {
'\\.(css|less|scss|sss|styl)$': '<rootDir>/node_modules/jest-css-modules',
},
moduleDirectories: ['node_modules', 'src/components', 'src/redux'],
}