-
-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathjest.config.js
43 lines (43 loc) · 1.25 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 = {
globalSetup: '<rootDir>/test/unit/globalSetup.js',
setupFiles: ['./test/unit/setup.ts'],
preset: 'ts-jest/presets/default-esm',
moduleFileExtensions: ['ts', 'js', 'vue'],
extensionsToTreatAsEsm: ['.ts'],
testEnvironment: 'jsdom',
testEnvironmentOptions: {
url: 'http://localhost/',
customExportConditions: ['node', 'node-addons'],
},
transform: {
'^.+\\.vue$': '@vue/vue3-jest',
'^.+\\.(t|j)s?$': [
'ts-jest',
{
tsconfig: 'tsconfig.test.json',
isolatedModules: true,
useESM: true,
},
],
'^.+\\.svg$': '<rootDir>/test/unit/jest-svg-transformer.cjs',
},
transformIgnorePatterns: ['/node_modules/.+.(js)$'],
roots: ['<rootDir>/src'],
snapshotSerializers: ['jest-serializer-vue'],
testMatch: ['**/(components|common)/**/*.spec.ts'],
globals: {
window: true,
'vue-jest': {
experimentalCSSCompile: false,
},
},
moduleNameMapper: {
'@/(.*)': '<rootDir>/src/$1',
},
cache: false,
collectCoverage: true,
collectCoverageFrom: ['<rootDir>/src/components/**/*.vue', '<rootDir>/src/common/utils/*.ts'],
coverageDirectory: '<rootDir>/coverage',
coverageProvider: 'v8',
coveragePathIgnorePatterns: ['/node_modules/', '/test/', '/dist/'],
};