-
Notifications
You must be signed in to change notification settings - Fork 71
/
Copy pathjest.config.js
39 lines (39 loc) · 1.23 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
const path = require('path');
module.exports = {
rootDir: path.join(__dirname),
moduleFileExtensions: ['js', 'jsx', 'json', 'vue', 'ts', 'tsx', 'node'],
moduleDirectories: ['node_modules', 'src'],
modulePaths: ['<rootDir>/src', '<rootDir>/node_modules'],
transform: {
'^.+\\.js$': 'babel-jest',
'^.+\\.vue$': 'vue-jest',
'.+\\.(css|styl|less|sass|scss|svg|png|jpg|ttf|woff|woff2|ogg)$': './jestFileTransformer.js',
'^.+\\.ts$': 'ts-jest',
},
transformIgnorePatterns: ['<rootDir>/node_modules/?!(vee-validate/dist/rules)'],
moduleNameMapper: {
'^@/(.*)$': '<rootDir>/src/$1',
'^@MOCKS/(.*)$': '<rootDir>/__mocks__/$1',
'\\.(css|less)$': 'identity-obj-proxy',
},
snapshotSerializers: ['jest-serializer-vue'],
testMatch: ['**/__tests__/**/**/*.spec.ts'],
testURL: 'http://localhost/',
globals: {
'ts-jest': {
babelConfig: true,
},
},
coverageDirectory: 'coverage',
collectCoverageFrom: [
'**/*.ts',
'**/*.vue',
'!**/node_modules/**',
'!**/__mocks__/**',
'!**/*.png',
'!**/*.ogg',
'!**/*.d.ts',
'!**/*.less',
],
setupFiles: ['./setupTests'],
};