-
-
Notifications
You must be signed in to change notification settings - Fork 0
/
jest.config.ts
34 lines (32 loc) · 1001 Bytes
/
jest.config.ts
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
import type { Config } from 'jest';
const config: Config = {
preset: 'ts-jest',
testEnvironment: 'jsdom',
setupFilesAfterEnv: ['<rootDir>/jest.setup.ts'],
moduleNameMapper: {
'^@/(.*)$': '<rootDir>/src/$1',
'^src/(.*)$': '<rootDir>/src/$1',
'^tests/(.*)$': '<rootDir>/tests/$1',
'^components/(.*)$': '<rootDir>/src/components/$1',
'\\.(css|less)$': '<rootDir>/__mocks__/styleMock.js'
},
moduleFileExtensions: ['vue', 'js', 'json', 'jsx', 'ts', 'tsx', 'node'],
moduleDirectories: ['node_modules', 'src'],
transform: {
'^.+\\.ts$': [
'ts-jest',
{
diagnostics: false,
isolatedModules: true,
tsconfig: '<rootDir>/tsconfig.jest.json'
}
],
'.*\\.(vue)$': '@vue/vue3-jest',
'^.+\\.js$': 'babel-jest'
},
testPathIgnorePatterns: ['/node_modules/', '/playwright-tests/', '/cypress-tests/', '/dist/'],
testEnvironmentOptions: {
customExportConditions: ['node', 'node-addons']
}
};
export default config;