-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathjest.config.js
More file actions
29 lines (28 loc) · 928 Bytes
/
jest.config.js
File metadata and controls
29 lines (28 loc) · 928 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
const tsPreset = require('ts-jest/jest-preset');
const mongoPreset = require('@shelf/jest-mongodb/jest-preset');
module.exports = {
preset: 'ts-jest',
globals: {
"ts-jest": {
"tsConfig": "./src/server/tsconfig.json"
}
},
testEnvironment: "node",
moduleFileExtensions: [
'js',
'ts',
'json',
'node'
],
moduleNameMapper: {
"^@Shared/(.*)": "<rootDir>/src/shared/$1",
"^@Config/(.*)": "<rootDir>/src/server/config/$1",
"^@Models/(.*)": "<rootDir>/src/server/models/$1",
"^@Services/(.*)": "<rootDir>/src/server/services/$1"
},
setupFilesAfterEnv: ["<rootDir>/src/server/setupTests.ts"],
globalSetup: '<rootDir>/node_modules/@shelf/jest-mongodb/setup.js',
globalTeardown: '<rootDir>/node_modules/@shelf/jest-mongodb/teardown.js',
testEnvironment: '<rootDir>/node_modules/@shelf/jest-mongodb/environment.js',
testMatch: ['<rootDir>/src/**/tests/api/**/*.ts'],
}