-
Notifications
You must be signed in to change notification settings - Fork 27
/
Copy pathjest.config.js
36 lines (36 loc) · 980 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
35
36
module.exports = {
verbose: true,
testEnvironment: "jsdom",
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/vue2-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/**',
'!**/.nuxt/**'
],
coverageDirectory: '<rootDir>/test/unit/coverage',
snapshotSerializers: ['jest-serializer-vue'],
transformIgnorePatterns: ['node_modules/(?!vee-validate/dist/rules)']
}