-
Notifications
You must be signed in to change notification settings - Fork 0
/
jest.config.js
24 lines (23 loc) · 732 Bytes
/
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
const { pathsToModuleNameMapper } = require('ts-jest');
// Assuming you have some TypeScript path aliases defined in your tsconfig.json
const { compilerOptions } = require('./tsconfig');
/** @type {import('ts-jest').JestConfigWithTsJest} */
module.exports = {
preset: 'ts-jest',
testEnvironment: 'node',
modulePathIgnorePatterns: ['<rootDir>/src/config.spec.ts'],
moduleNameMapper: {
...pathsToModuleNameMapper({ '@/*': ['./src/*'] }, { prefix: '<rootDir>/' }),
'^(\\.{1,2}/.*)\\.js$': '$1',
},
extensionsToTreatAsEsm: ['.ts'],
transform: {
'^.+\\.ts?$': [
'ts-jest',
{
useESM: true,
},
],
},
setupFilesAfterEnv: ['<rootDir>/tests/env.ts', '<rootDir>/tests/utils.ts']
};