-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathjest.config.ts
More file actions
29 lines (27 loc) · 901 Bytes
/
jest.config.ts
File metadata and controls
29 lines (27 loc) · 901 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
import { pathsToModuleNameMapper } from 'ts-jest';
/** Duplicate the paths found in tsconfig. */
const paths = {
'@const/*': ['const/*'],
'@models': ['models'],
'@models/*': ['models/*'],
'@routes/*': ['routes/*'],
'@schema/*': ['schema/*'],
'@security/*': ['security/*'],
'@server/*': ['server/*'],
'@services/*': ['services/*'],
'@utils/*': ['utils/*'],
'@lib/*': ['lib/*'],
};
module.exports = {
preset: 'ts-jest',
testEnvironment: 'node',
setupFiles: ['dotenv/config'],
roots: ['./__tests__'],
testMatch: ['**/__tests__/**/*.spec.ts'],
collectCoverageFrom: ['src/**/*.{js,jsx,ts,tsx}'],
modulePathIgnorePatterns: ['./__tests__/old'],
// A map from regular expressions to module names or to arrays of module names that allow to stub out resources with a single module
moduleNameMapper: pathsToModuleNameMapper(paths, {
prefix: '<rootDir>/src/',
}),
};