-
Notifications
You must be signed in to change notification settings - Fork 11
/
unit.jest.config.js
51 lines (51 loc) · 1.16 KB
/
unit.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 = {
name: 'unit',
automock: false,
displayName: 'Unit Tests',
collectCoverageFrom: [
"src/**/*.{js,jsx,ts,tsx}"
],
setupFiles: [
"<rootDir>/config/polyfills.js",
"<rootDir>/setupJest.ts",
],
testMatch: [
"<rootDir>/src/**/__tests__/**/*.(j|t)s?(x)",
"<rootDir>/src/**/?(*.)(spec|test).(j|t)s?(x)"
],
testEnvironment: "jsdom",
testURL: process.env.TEST_HOST || "http://localhost:4444",
transform: {
"^.+\\.(js|jsx|mjs)$": "<rootDir>/node_modules/babel-jest",
"^.+\\.tsx?$": "ts-jest",
"^.+\\.css$": "<rootDir>/config/jest/cssTransform.js",
"^.+\\.ya?ml$": "<rootDir>/config/jest/yamlTransform.js",
"^(?!.*\\.(js|jsx|mjs|css|json)$)": "<rootDir>/config/jest/fileTransform.js"
},
transformIgnorePatterns: [
"[/\\\\]node_modules[/\\\\].+\\.(js|jsx|mjs|ts|tsx)$"
],
moduleNameMapper: {
"^react-native$": "react-native-web"
},
moduleFileExtensions: [
"web.ts",
"ts",
"web.tsx",
"tsx",
"web.js",
"js",
"yml",
"yaml",
"web.jsx",
"jsx",
"json",
"node",
"mjs"
],
globals: {
"ts-jest": {
"tsConfig": "tsconfig.test.json"
}
}
};