-
Notifications
You must be signed in to change notification settings - Fork 0
/
jest.config.js
49 lines (48 loc) · 1.2 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
const path = require('path');
// This is largely inspired by createJestConfig.js from react-scripts-ts
// Note that we are dependent on the above for polyfills
module.exports = {
collectCoverageFrom: [
'src/**/*.{js,jsx,ts,tsx}',
`!**/**/*.mock.*`
],
coverageDirectory: './reports/tests/coverage',
setupFiles: [path.resolve(__dirname,'node_modules/react-scripts-ts/config/polyfills')],
testMatch: [
`${__dirname}/src/**/__tests__/**/*.(j|t)s?(x)`,
`${__dirname}/src/**/?(*.)(spec|test).(j|t)s?(x)`,
],
testEnvironment: 'node',
testURL: 'http://localhost',
testResultsProcessor: "jest-junit",
transform: {
'^.+\\.(js|jsx|mjs)$': 'babel-jest',
'^.+\\.tsx?$': 'ts-jest/preprocessor',
'^.+\\.css$': 'jest-css',
'^(?!.*\\.(js|jsx|mjs|css|json)$)': 'jest-file',
},
transformIgnorePatterns: [
'[/\\\\]node_modules[/\\\\].+\\.(js|jsx|mjs|ts|tsx)$',
],
moduleNameMapper: {
'^react-native$': 'react-native-web',
},
moduleFileExtensions: [
'web.ts',
'ts',
'web.tsx',
'tsx',
'web.js',
'js',
'web.jsx',
'jsx',
'json',
'node',
'mjs',
],
globals: {
'ts-jest': {
tsConfigFile: './tsconfig.test.json',
},
},
};