-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathjest.config.js
59 lines (57 loc) · 1.19 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
process.env.VUE_CLI_BABEL_TARGET_NODE = true;
process.env.VUE_CLI_BABEL_TRANSPILE_MODULES = true;
let { TEST_DIR } = process.env;
if (TEST_DIR === undefined) {
TEST_DIR = '**';
}
module.exports = {
collectCoverageFrom: [
'lib/**/*.js',
'!**/node_modules/**',
],
coverageDirectory: '<rootDir>/tests/coverage',
coverageThreshold: {
'lib/': {
branches: 60,
functions: 60,
lines: 60,
statements: 60,
},
'lib/controller': {
branches: 40,
functions: 60,
lines: 60,
statements: 60,
},
'lib/db': {
branches: 75,
functions: 75,
lines: 75,
statements: 75,
},
},
moduleFileExtensions: [
'js',
'json',
'vue',
],
transform: {
'^.+\\.vue$': 'vue-jest',
'.+\\.(css|styl|less|sass|scss|svg|png|jpg|ttf|woff|woff2)$': 'jest-transform-stub',
'^.+\\.js$': 'babel-jest',
},
moduleNameMapper: {
'^@/(.*)$': '<rootDir>/$1',
},
setupFilesAfterEnv: [
'<rootDir>/tests/unitSetup.js',
],
snapshotSerializers: [
'jest-serializer-vue',
],
testEnvironment: 'node',
testMatch: [
`**/tests/jest/${TEST_DIR}/*.spec.js`,
],
testURL: 'https://localhost:8080/',
};