blob: f4dba3e028c3d129efab9816e3ac496732ee5dd1 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
|
// Configures Jest, the testing engine
// -- Sets test environment, module resolution, and TS integration via ts-jest.
// -- Must align with tsconfig.json and sometimes vite.config.mts.
// -- Must match paths and module resolution from tsconfig.json.
// -- Uses ts-jest to compile TS like Vite does.
export default {
preset: 'ts-jest',
testEnvironment: 'jsdom',
// setupFilesAfterEnv: ['./setupTests.ts'],
transform: {
'^.+\\.tsx?$': ['ts-jest', {
tsconfig: 'tsconfig.json',
diagnostics: false,
}],
},
moduleNameMapper: {
'\\.(css|less|scss|sass)$': 'identity-obj-proxy',
'^@/(.*)$': '<rootDir>/src/$1',
},
};
|