-
Notifications
You must be signed in to change notification settings - Fork 0
/
jest.config.js
32 lines (30 loc) · 898 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
const aliases = require('./aliases.js').default;
// Jest wants a different format than webpack
Object.keys(aliases).forEach((key) => {
// we escape the @ in the aliases key
aliases[`^\\${key}/(.*)`] = `${aliases[key]}/$1`;
delete aliases[key];
});
module.exports = {
coverageDirectory: '<rootDir>/local/coverage',
setupFilesAfterEnv: ['<rootDir>/src/tests/unit/vueSetup.js'],
preset: '@vue/cli-plugin-unit-jest',
snapshotSerializers: ['jest-serializer-vue'],
collectCoverage: true,
collectCoverageFrom: [
'src/components/**/*.{js,vue}',
'!**/node_modules/**',
'src/js/**/*.{js}',
],
moduleFileExtensions: ['js', 'json', 'vue'],
moduleNameMapper: {
...aliases,
},
transform: {
'.*\\.(vue)$': 'vue-jest',
'vee-validate/dist/rules': 'babel-jest',
},
transformIgnorePatterns: [
'<rootDir>/node_modules/(?!vee-validate/dist/rules)',
],
};