-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathjest.config.js
More file actions
34 lines (33 loc) · 812 Bytes
/
jest.config.js
File metadata and controls
34 lines (33 loc) · 812 Bytes
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
module.exports = {
preset: '@vue/cli-plugin-unit-jest',
testEnvironment: 'jsdom',
testEnvironmentOptions: {
customExportConditions: ['node', 'node-addons'],
},
setupFilesAfterEnv: ['<rootDir>/tests/setup.ts'],
transform: {
'^.+\\.vue$': '@vue/vue3-jest',
'^.+\\.tsx?$': ['ts-jest', {
tsconfig: {
jsx: 'preserve',
esModuleInterop: true,
allowSyntheticDefaultImports: true,
},
}],
},
testMatch: [
'**/tests/unit/**/*.spec.(js|jsx|ts|tsx)',
],
moduleFileExtensions: ['js', 'ts', 'json', 'vue'],
moduleNameMapper: {
'^@/(.*)$': '<rootDir>/src/$1',
},
collectCoverage: true,
collectCoverageFrom: [
'src/**/*.{js,ts,vue}',
'!src/main.ts',
'!src/App.vue',
'!src/shims-vue.d.ts',
'!**/node_modules/**',
],
};