-
Notifications
You must be signed in to change notification settings - Fork 3
/
jest.config.js
31 lines (30 loc) · 943 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
const { pathsToModuleNameMapper } = require('ts-jest/utils');
const { compilerOptions } = require('./tsconfig');
module.exports = {
moduleFileExtensions: ['js', 'ts', 'json', 'vue'],
testRegex: '(/__tests__/.*|(\\.|/)(test|spec))\\.(jsx?|tsx?)$',
transform: {
'^.+\\.tsx?$': 'ts-jest',
'.*\\.(vue)$': 'vue-jest',
},
testURL: 'http://localhost/',
moduleNameMapper: {
...pathsToModuleNameMapper(compilerOptions.paths, { prefix: '<rootDir>/src/' }),
'^lodash-es$': 'lodash',
},
snapshotSerializers: ['jest-serializer-vue'],
transformIgnorePatterns: ['/node_modules/(?!lodash-es)'],
globals: {
'vue-jest': {
babelConfig: {
plugins: ['@babel/plugin-transform-runtime'],
presets: [['@babel/preset-env', { modules: false }]],
env: {
test: {
presets: [['@babel/preset-env', { targets: { node: 'current' } }]],
},
},
},
},
},
};