-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathjest.config.js
More file actions
44 lines (41 loc) · 1.26 KB
/
jest.config.js
File metadata and controls
44 lines (41 loc) · 1.26 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
const { pathsToModuleNameMapper } = require('ts-jest');
const { compilerOptions } = require('../../tsconfig.base.json');
// Suppress TypeScript ESLint deprecation warnings
const originalWarn = process.emitWarning;
process.emitWarning = function(warning, type, code) {
if (
typeof warning === 'string' &&
warning.includes('The \'argument\' property is deprecated on TSImportType nodes')
) {
return;
}
originalWarn.call(process, warning, type, code);
};
module.exports = {
preset: 'ts-jest',
testEnvironment: 'node',
roots: ['<rootDir>/src', '<rootDir>/tests'],
testMatch: ['**/*.spec.ts'],
setupFilesAfterEnv: ['<rootDir>/tests/setup.ts'],
collectCoverageFrom: ['src/**/*.ts'],
moduleFileExtensions: ['js', 'ts'],
transform: {
'^.+\\.[tj]s$': [
'ts-jest',
{
tsconfig: '<rootDir>/tsconfig.spec.json',
},
],
},
transformIgnorePatterns: [
'node_modules/(?!([^/]*/)*((@faker-js|@scure|@noble|@ethereumjs|uuid)))',
'node_modules/@digitaldefiance/mongoose-types',
],
moduleNameMapper: {
'^@digitaldefiance/mongoose-types$':
'<rootDir>/../../packages/digitaldefiance-mongoose-types/src/index.js',
...pathsToModuleNameMapper(compilerOptions.paths, {
prefix: '<rootDir>/../../',
}),
},
};