-
Notifications
You must be signed in to change notification settings - Fork 5
/
jest.config.js
37 lines (37 loc) · 1 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
module.exports = {
preset: 'ts-jest',
verbose: true,
setupFilesAfterEnv: ['<rootDir>/tests/unit/setup/index.ts'],
moduleNameMapper: {
'^@/(.*)$': '<rootDir>/$1',
'^~/(.*)$': '<rootDir>/$1',
'^vue$': 'vue/dist/vue.common.js'
},
transform: {
// process `*.vue` files with `vue-jest`
'.*\\.(vue)$': 'vue-jest',
// process js with `ts-jest`
'^.+\\.js$': 'ts-jest',
// Stub non js file
'.+\\.(css|styl|less|sass|scss|png|jpg|svg|ttf|woff|woff2)$':
'jest-transform-stub'
},
collectCoverage: true,
collectCoverageFrom: [
'**/components/**/*.{ts,vue}',
'**/layouts/**/*.{ts,vue}',
'**/pages/**/*.{ts,vue}',
'!**/node_modules/**',
'!**/coverage/**'
],
coverageDirectory: '<rootDir>/tests/unit/coverage',
snapshotSerializers: ['jest-serializer-vue'],
transformIgnorePatterns: [
'node_modules/(?!vee-validate/dist/rules|@nuxtjs/composition-api)'
],
globals: {
'ts-jest': {
tsconfig: '<rootDir>/tests/unit/tsconfig.json'
}
}
}