-
Notifications
You must be signed in to change notification settings - Fork 0
/
jest.config.js
40 lines (40 loc) · 1.04 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
module.exports = {
transform: {
'^.+\\.jsx?$': 'babel-jest',
'^.+\\.tsx?$': 'ts-jest'
},
testRegex: '(/__tests__/.*|(\\.|/)(test))\\.(jsx?|tsx?)$',
// Automatically reset mocks between tests. Avoids some boilerplate in test suites.
resetMocks: true,
// Importing options
moduleDirectories: ['.', 'node_modules'],
moduleFileExtensions: [
'ts',
'tsx',
'js',
'jsx',
'json',
'node'
],
setupFiles: [
// these are run just as Jest is setting up a testing environment
'<rootDir>/scripts/tests/testSetup.js',
],
moduleNameMapper: {
'\\.scss$': '<rootDir>/scripts/tests/mockFile.js'
},
collectCoverage: true,
collectCoverageFrom: [
'src/**/*.{ts,tsx,js,jsx}',
'!src/config.*.{ts,js,json}',
'!**/*.d.ts',
'!**/node_modules/**',
],
coverageReporters: ['json', 'lcov'],
globals: {
'NODE_ENV': 'test',
'ts-jest': {
'useBabelrc': true
}
}
};