-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathjest.config.js
36 lines (35 loc) · 915 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
// process.env.TZ = 'GMT+0800';
module.exports = {
globalSetup: './jest-global-setup.js',
preset: 'ts-jest',
moduleFileExtensions: ['js', 'jsx', 'json', 'vue', 'ts'],
globals: {
'ts-jest': {
tsconfig: {
target: 'ES2019',
},
},
},
transform: {
'^.+\\.vue$': 'vue-jest',
'.+\\.(css|styl|less|sass|scss|svg|png|jpg|ttf|woff|woff2)$':
'jest-transform-stub',
'^.+\\.jsx?$': 'babel-jest',
'^.+\\.js$': '<rootDir>/node_modules/babel-jest',
'^.+\\.(j|t)sx?$': 'ts-jest',
},
// transform: {
// '^.+\\.[t|j]sx?$': [
// 'babel-jest',
// {
// presets: ['@babel/preset-env', '@babel/preset-typescript'],
// },
// ],
// },
transformIgnorePatterns: ['/node_modules/*'],
moduleNameMapper: {
axios: 'axios/dist/node/axios.cjs',
},
testEnvironment: 'jsdom',
coverageDirectory: '<rootDir>/test/unit/coverage',
};