-
Notifications
You must be signed in to change notification settings - Fork 10
/
Copy pathjest.config.js
34 lines (28 loc) · 1.37 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
module.exports = {
// A list of paths to directories that Jest should use to search for files in
// https://jestjs.io/docs/configuration#roots-arraystring
roots: ['<rootDir>/app/'],
// The test environment that will be used for testing, jsdom for browser environment
// https://jestjs.io/docs/configuration#testenvironment-string
testEnvironment: 'jsdom',
// Jest transformations
// https://jestjs.io/docs/configuration#transform-objectstring-pathtotransformer--pathtotransformer-object
transform: {
'^.+\\.tsx?$': 'ts-jest', // Transform TypeScript files using ts-jest
},
// A list of paths to modules that run some code to configure or set up the testing framework before each test file in the suite is executed
// https://jestjs.io/docs/configuration#setupfilesafterenv-array
setupFilesAfterEnv: ['<rootDir>/jest.setup.ts'],
// Code coverage config
// https://jestjs.io/docs/configuration#collectcoveragefrom-array
coverageDirectory: '<rootDir>/coverage/',
collectCoverageFrom: ['<rootDir>/app/**/*.{ts,tsx}', '!**/node_modules/**', '!**/*.d.ts'],
// Important: order matters, specific rules should be defined first
// https://jestjs.io/fr/docs/configuration#modulenamemapper-objectstring-string--arraystring
moduleNameMapper: {
// app/ absolute module alias
'app/(.*)': '<rootDir>/app/$1',
},
verbose: true,
testTimeout: 30000,
};