-
-
Notifications
You must be signed in to change notification settings - Fork 2
/
jest-unit.config.js
37 lines (36 loc) · 1.15 KB
/
jest-unit.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
const {jsWithBabel: tsjPreset} = require("ts-jest/preset")
module.exports = {
testEnvironment: "node",
moduleFileExtensions: ["ts", "tsx", "js", "jsx", "json", "node"],
modulePathIgnorePatterns: ["<rootDir>/tmp", "<rootDir>/dist", "<rootDir>/templates"],
moduleNameMapper: {},
setupFilesAfterEnv: ["<rootDir>/jest.setup.js"],
transform: {
...tsjPreset.transform,
},
transformIgnorePatterns: ["[/\\\\]node_modules[/\\\\].+\\.(js|jsx)$"],
testMatch: ["<rootDir>/**/*.(spec|test).{ts,tsx,js,jsx}"],
testURL: "http://localhost",
// watchPlugins: [
// require.resolve("jest-watch-typeahead/filename"),
// require.resolve("jest-watch-typeahead/testname"),
// ],
coverageReporters: ["json", "lcov", "text", "clover"],
// collectCoverage: !!`Boolean(process.env.CI)`,
collectCoverageFrom: ["src/**/*.{ts,tsx,js,jsx}"],
coveragePathIgnorePatterns: ["/templates/"],
// coverageThreshold: {
// global: {
// branches: 100,
// functions: 100,
// lines: 100,
// statements: 100,
// },
// },
globals: {
"ts-jest": {
tsconfig: __dirname + "/tsconfig.test.json",
isolatedModules: true,
},
},
}