-
-
Notifications
You must be signed in to change notification settings - Fork 19
Expand file tree
/
Copy pathjest.config.js
More file actions
28 lines (28 loc) · 810 Bytes
/
jest.config.js
File metadata and controls
28 lines (28 loc) · 810 Bytes
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
import { pathsToModuleNameMapper } from 'ts-jest';
import tsConfig from './tsconfig.json' with { type: 'json' };
export default {
testTimeout: 15000,
transform: {
'\\.ts$': [
'ts-jest',
{
useESM: true,
},
],
},
preset: 'ts-jest',
verbose: true,
extensionsToTreatAsEsm: ['.ts'],
moduleNameMapper: {
...(tsConfig.compilerOptions.paths &&
pathsToModuleNameMapper(tsConfig.compilerOptions.paths, {
prefix: '<rootDir>/',
})),
// Jest-resolve doesn't know that Node wants .js extensions in imports
'^(\\.{1,2}/.*)\\.js$': '$1',
},
modulePathIgnorePatterns: ['<rootDir>/dist/'],
setupFiles: ['dotenv/config'],
globalSetup: '<rootDir>/api/test/postgres.setup.mjs',
globalTeardown: '<rootDir>/api/test/postgres.teardown.mjs',
};