-
Notifications
You must be signed in to change notification settings - Fork 4
/
jest.config.js
executable file
·50 lines (50 loc) · 1.5 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
module.exports = {
preset: "ts-jest",
globals: {
__DEV__: true
},
setupFilesAfterEnv: ["<rootDir>/test/jest/jest.setup.js"],
// noStackTrace: true,
bail: true,
cache: false,
verbose: true,
collectCoverage: false,
coverageDirectory: "<rootDir>/docs/unit-test",
collectCoverageFrom: [
"<rootDir>/src/**/*.vue",
"<rootDir>/src/**/*.js",
"<rootDir>/src/**/*.ts",
"<rootDir>/src/**/*.jsx"
],
coverageThreshold: {
global: {
// branches: 50,
// functions: 50,
// lines: 50,
// statements: 50
}
},
coverageReporters: ["json", "lcov", "text", "clover"],
testMatch: [
"<rootDir>/test/jest/__tests__/**/*.spec.ts",
"<rootDir>/test/jest/__tests__/**/*.test.ts",
"<rootDir>/test/jest/__tests__/**/*.spec.js",
"<rootDir>/test/jest/__tests__/**/*.test.js",
"<rootDir>/src/**/__tests__/*_jest.spec.js"
],
moduleFileExtensions: ["vue", "js", "jsx", "json", "ts", "tsx", "node"],
moduleNameMapper: {
"^vue$": "<rootDir>/node_modules/vue/dist/vue.common.js",
"^test-utils$":
"<rootDir>/node_modules/@vue/test-utils/dist/vue-test-utils.js",
"^quasar$": "<rootDir>/node_modules/quasar/dist/quasar.umd.js",
"^~/(.*)$": "<rootDir>/$1",
"^src/(.*)$": "<rootDir>/src/$1",
".*css$": "<rootDir>/test/jest/utils/stub.css"
},
transform: {
".*\\.vue$": "<rootDir>/node_modules/vue-jest",
".*\\.js$": "<rootDir>/node_modules/babel-jest"
},
snapshotSerializers: ["<rootDir>/node_modules/jest-serializer-vue"]
};