-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathjest.config.js
51 lines (41 loc) · 1.74 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
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
module.exports = {
// The directory where Jest should store its cached dependency information
cacheDirectory: './.tmp/jest',
// Automatically clear mock calls and instances between every test
clearMocks: true,
// Indicates whether the coverage information should be collected while executing the test
collectCoverage: true,
// The directory where Jest should output its coverage files
coverageDirectory: 'coverage/jest',
// A list of reporter names that Jest uses when writing coverage reports
// Add 'text' to show the output in the console.
coverageReporters: ['json', 'lcovonly'],
// An array of directory names to be searched recursively up from the requiring module's location
// Keep this in sync with resolve.modules in the webpack config!
moduleDirectories: ['node_modules'],
// A list of paths to modules that run some code to configure or set up the testing framework before each test
setupFilesAfterEnv: [
'<rootDir>/jest.setup.js',
'regenerator-runtime/runtime',
],
// The test environment that will be used for testing
testEnvironment: 'jsdom',
// The glob patterns Jest uses to detect test files
testMatch: ['**/__tests__/**/*.[jt]s?(x)', '**/?(*.)+(jest).[tj]s?(x)'],
moduleNameMapper: {
'\\.(css|less|scss|sass)$': 'identity-obj-proxy',
},
// A map from regular expressions to paths to transformers
transform: {
'\\.tsx?$': 'ts-jest',
'\\.jsx?$': 'babel-jest',
'^.+\\.tsx?$': [
'ts-jest',
{
// ts-jest config options go here
packageJson: 'package.json',
// Add other ts-jest options here as needed
},
],
},
};