-
Notifications
You must be signed in to change notification settings - Fork 18
Expand file tree
/
Copy pathjest.config.ts
More file actions
31 lines (29 loc) · 904 Bytes
/
jest.config.ts
File metadata and controls
31 lines (29 loc) · 904 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
29
30
31
import { readFileSync } from 'node:fs';
import { pathsToModuleNameMapper } from 'ts-jest';
const { compilerOptions } = JSON.parse(
readFileSync('./tsconfig.json', { encoding: 'utf8' }),
);
export default {
projects: [
{
displayName: 'Unit test',
moduleDirectories: ['node_modules', process.cwd()],
moduleNameMapper: pathsToModuleNameMapper(compilerOptions.paths),
preset: 'ts-jest',
rootDir: 'src',
setupFilesAfterEnv: ['dotenv/config'],
testEnvironment: 'node',
testRegex: '\\.spec\\.ts$',
},
{
displayName: 'E2E test',
moduleDirectories: ['node_modules', process.cwd()],
moduleNameMapper: pathsToModuleNameMapper(compilerOptions.paths),
preset: 'ts-jest',
rootDir: 'test',
setupFilesAfterEnv: ['dotenv/config'],
testEnvironment: 'node',
testRegex: '\\.end2end.spec\\.ts$',
},
],
};