-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathjest.config.js
40 lines (39 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
/** @type {import('ts-jest/dist/types').InitialOptionsTsJest} */
const path = require('path')
module.exports = {
preset: 'ts-jest',
verbose: true,
rootDir: path.resolve(__dirname, './'),
moduleFileExtensions: ['ts', 'tsx', 'js', 'jsx', 'vue'],
transform: {
'^.+\\.(vue|md)$': '<rootDir>/node_modules/@vue/vue3-jest',
'^.+\\.(js|jsx)$': '<rootDir>/node_modules/babel-jest',
'^.+\\.(ts|tsx)$': '<rootDir>/node_modules/ts-jest',
},
transformIgnorePatterns: [
'node_modules',
],
moduleNameMapper: {
'^@/(.*)$': '<rootDir>/$1',
'k-view-next$': '<rootDir>/components/index.ts',
'k-view-next/es': '<rootDir>/components',
},
testMatch: [
'**/*/__tests__/**/*.spec.js',
],
snapshotSerializers: ['<rootDir>/node_modules/jest-serializer-vue'],
setupFiles: [
'<rootDir>/tests/setup/jest.init.js',
],
coverageDirectory: '<rootDir>/coverage',
collectCoverageFrom: [
'components/**/*.ts',
'components/**/*.tsx',
],
testEnvironment: 'jsdom',
globals: {
'ts-jest': {
babelConfig: true,
},
},
}