-
-
Notifications
You must be signed in to change notification settings - Fork 8
/
jest.config.js
52 lines (52 loc) · 1.14 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
const path = require('path')
module.exports = {
rootDir: path.join(__dirname),
moduleFileExtensions: [
'js',
'jsx',
'json',
'vue',
'ts',
'tsx',
'node'
],
moduleDirectories: ['node_modules', 'src'],
modulePaths: ['<rootDir>/src', '<rootDir>/node_modules'],
transform: {
"^.+\\.js$": "babel-jest",
'^.+\\.vue$': 'vue-jest',
'.+\\.(css|styl|less|sass|scss|svg|png|jpg|ttf|woff|woff2|ogg)$': 'jest-transform-stub',
"^.+\\.ts$": "ts-jest",
},
transformIgnorePatterns: [
'<rootDir>/node_modules/?!(vee-validate/dist/rules)',
],
moduleNameMapper: {
"^@/(.*)$": "<rootDir>/src/$1",
"^@MOCKS/(.*)$": "<rootDir>/__mocks__/$1",
"\\.(css|less)$": "identity-obj-proxy"
},
snapshotSerializers: [
'jest-serializer-vue'
],
testMatch: [
'**/__tests__/**/**/*.spec.ts',
],
testURL: 'http://localhost/',
globals: {
'ts-jest': {
babelConfig: true,
},
},
coverageDirectory: "coverage",
collectCoverageFrom: [
"**/*.ts",
"**/*.vue",
"!**/node_modules/**",
"!**/__mocks__/**",
"!**/*.png",
"!**/*.ogg",
"!**/*.d.ts",
"!**/*.less",
],
}