-
Notifications
You must be signed in to change notification settings - Fork 12
Expand file tree
/
Copy pathjest.e2e.config.ts
More file actions
35 lines (32 loc) · 1.09 KB
/
jest.e2e.config.ts
File metadata and controls
35 lines (32 loc) · 1.09 KB
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
import type { Config } from '@jest/types';
const moduleNameMapper = {
'^@prisma/client$': '<rootDir>/src/generated/prisma/client',
'@/generated/(.*)': '<rootDir>/src/generated/$1',
'@/(.*)': '<rootDir>/src/$1',
'@e2e/(.*)': '<rootDir>/tests/e2e/$1',
'^(\\.{1,2}/.*)\\.js$': '$1',
};
const config: Config.InitialOptions = {
preset: 'ts-jest/presets/default-esm',
displayName: 'E2E Tests',
verbose: true,
moduleNameMapper,
roots: ['<rootDir>/tests/e2e', '<rootDir>/src'],
testMatch: ['<rootDir>/tests/e2e/**/*.test.ts'],
extensionsToTreatAsEsm: ['.ts'],
globals: {
'ts-jest': {
useESM: true,
tsconfig: 'tsconfig.test.json',
},
},
testEnvironment: 'node',
globalSetup: '<rootDir>/tests/e2e/setup/globalSetup.ts',
globalTeardown: '<rootDir>/tests/e2e/setup/globalTeardown.ts',
setupFilesAfterEnv: ['<rootDir>/tests/e2e/setup/testEnvironment.ts'],
// Per-test timeout (applies to each `test(...)` and async hooks in test files)
testTimeout: 1_200_000, // 20 minutes
maxWorkers: 3,
collectCoverageFrom: ['src/**/*.ts', '!src/**/*.spec.ts', '!src/**/*.test.ts'],
};
export default config;