-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathjest.config.js
34 lines (34 loc) · 926 Bytes
/
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
module.exports = {
verbose: true,
moduleNameMapper: {
'^@/(.*)$': '<rootDir>/$1',
'^~/(.*)$': '<rootDir>/$1',
'^vue$': 'vue/dist/vue.common.js'
},
moduleFileExtensions: [
'js',
'json',
// tell Jest to handle `*.vue` files
'vue'
],
transform: {
// process `*.vue` files with `vue-jest`
'.*\\.(vue)$': 'vue-jest',
// process js with `babel-jest`
'^.+\\.js$': 'babel-jest',
// Stub non js file
'.+\\.(css|styl|less|sass|scss|png|jpg|svg|ttf|woff|woff2)$':
'jest-transform-stub'
},
collectCoverage: true,
collectCoverageFrom: [
'**/components/**/*.{js,vue}',
'**/layouts/**/*.{js,vue}',
'**/pages/**/*.{js,vue}',
'!**/node_modules/**',
'!**/coverage/**'
],
coverageDirectory: '<rootDir>/test/unit/coverage',
snapshotSerializers: ['jest-serializer-vue'],
transformIgnorePatterns: ['node_modules/(?!vee-validate/dist/rules)']
}