-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathjest.config.ts
43 lines (41 loc) · 1.07 KB
/
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
35
36
37
38
39
40
41
42
43
import type { Config } from 'jest';
const jestConfig: Config = {
// extensionsToTreatAsEsm: ['.ts', '.tsx'],
moduleNameMapper: {
'^@/(.*)$': '<rootDir>/src/$1',
'\\.(css|less|scss|sass)$': 'identity-obj-proxy',
},
preset: 'ts-jest',
// preset: 'ts-jest/presets/default-esm',
setupFilesAfterEnv: ['<rootDir>/jest.setup.ts'],
transform: {
'^.+\\.(ts|tsx)$': [
'ts-jest',
{
diagnostics: {
ignoreCodes: [1343],
},
astTransformers: {
before: [
{
path: 'ts-jest-mock-import-meta',
options: {
metaObjectReplacement: {
env: {
VITE_ENV: 'test',
VITE_FAKE_LOGIN: 'true',
VITE_DEBUG: 'true',
VITE_VERSION: 'test',
VITE_PUBLIC_URL: 'http://localhost:3000',
},
},
},
},
],
},
},
],
},
testEnvironment: 'jest-environment-jsdom',
};
export default jestConfig;