-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathjest.config.js
More file actions
49 lines (43 loc) · 1.07 KB
/
jest.config.js
File metadata and controls
49 lines (43 loc) · 1.07 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
36
37
38
39
40
41
42
43
44
45
46
47
48
49
/**
* For a detailed explanation regarding each configuration property, visit:
* https://jestjs.io/docs/en/configuration.html
*/
module.exports = {
testTimeout: 30000,
/**
* The test environment that will be used for testing
*/
testEnvironment: 'node',
/**
* For testing mongodb queries
*/
preset: '@shelf/jest-mongodb',
/**
* Setup file to provide global APIs needed by MongoDB driver
*/
setupFilesAfterEnv: ['<rootDir>/test/setup.ts'],
/**
* TypeScript support
*/
transform: {
'^.+\\.tsx?$': ['ts-jest', {
tsconfig: 'test/tsconfig.json',
}],
},
/**
* Map node: prefixed imports to mock files
* Jest 27 supports node: prefix for ESM imports, but CommonJS require('node:crypto')
* in modules like argon2.cjs still needs explicit mapping to mocks
*/
moduleNameMapper: {
'^node:crypto$': '<rootDir>/test/__mocks__/node_crypto.js',
'^node:util$': '<rootDir>/test/__mocks__/node_util.js',
},
/**
* Ignore folders
*/
testPathIgnorePatterns: [
'/node_modules/',
'/integration/',
],
};