-
Notifications
You must be signed in to change notification settings - Fork 0
/
jest.config.js
82 lines (67 loc) · 1.72 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
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
module.exports = {
verbose: true,
// Appended to the tests names
displayName: {
name: "eProtocole",
color: "blue",
},
// Global variables
globals: {
__DEV__: true,
},
// Global setup
// globalSetup: "<rootDir>/jest.global.setup.js",
// setupFiles: ["<rootDir>/src/__tests__/index.js"],
setupFilesAfterEnv: ["<rootDir>/tests/index.js"],
roots: ["<rootDir>/tests"],
moduleNameMapper: {
"^@/(.*)$": "<rootDir>/src/$1",
"^~/(.*)$": "<rootDir>/src/$1",
// '^vue$': 'vue/dist/vue.common.js',
"vuetify/lib(.*)": "<rootDir>/node_modules/vuetify/es5$1",
},
modulePaths: [
// "<rootDir>",
"<rootDir>/src",
"<rootDir>/node_modules",
],
moduleFileExtensions: ["js", "vue", "json"],
transform: {
"^.+\\.js$": "babel-jest",
".*\\.(vue)$": "vue-jest",
},
// activate code coverage measurements
collectCoverage: true,
collectCoverageFrom: ["<rootDir>/src/**/*.vue", "<rootDir>/src/**/*.js"],
coverageDirectory: "<rootDir>/artifacts",
coveragePathIgnorePatterns: ["dist", "/node_modules/"],
// Define some specific coverage thresholds
coverageThreshold: {
global: {
branches: 50,
functions: 50,
lines: 50,
statements: 50,
},
"./src/components/": {
branches: 40,
statements: 40,
},
// "./src/views/": {
// "branches": 40,
// "statements": 40
// },
// "./src/reducers/**/*.js": {
// "statements": 90
// },
// "./src/api/very-important-module.js": {
// "branches": 100,
// "functions": 100,
// "lines": 100,
// "statements": 100
// }
},
// Testing in the browser vs Node.js
testEnvironment: "jsdom",
preset: "@vue/cli-plugin-unit-jest",
};