-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathjest.config.js
43 lines (43 loc) · 1.15 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
38
39
40
41
42
43
module.exports = {
preset: 'ts-jest',
testEnvironment: 'node',
roots:['<rootDir>/tests/unit'],
setupFiles: ['<rootDir>/tests/unit/jest.setup.ts'],
modulePaths: [
'<rootDir>',
],
moduleDirectories: [
'node_modules',
],
globals: {
'ts-jest': {
babelConfig: './babel.config.js',
},
},
moduleFileExtensions: ['js', 'ts', 'tsx', 'json', 'vue'],
transform: {
// process `*.vue` files with `vue-jest`
'.*\\.(vue)$': 'vue-jest',
'.*\\.(js)$': 'babel-jest',
'^.+\\.tsx?$': 'ts-jest',
".+\\.(css|styl|less|sass|scss|svg|png|jpg|ttf|woff|woff2)$": "jest-transform-stub"
},
transformIgnorePatterns: ['node_modules'],
testRegex: '(/tests/unit/.*|(\\.|/)(test|spec))\\.(jsx?|tsx?)$',
testPathIgnorePatterns: [
'<rootDir>/tests/unit/jest.setup.ts',
// '<rootDir>/tests/unit/mocks',
],
moduleNameMapper: {
'^@/(.*)$': '<rootDir>/src/$1',
// "^~/(.*)$": "<rootDir>/src/$1",
'^vue$': 'vue/dist/vue.common.js',
},
collectCoverage: true,
collectCoverageFrom: [
'**/*.{vue,ts,tsx}',
'!**/node_modules/**',
'!**/coverage/**',
],
coveragePathIgnorePatterns: ['node_modules'],
};