forked from Digital-Defiance/i18n-lib
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathjest.config.js
More file actions
40 lines (38 loc) · 1.07 KB
/
Copy pathjest.config.js
File metadata and controls
40 lines (38 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
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'],
collectCoverageFrom: ['src/**/*.ts'],
transform: {
'^.+\\.(ts|tsx)$': [
'ts-jest',
{
tsconfig: {
...require('./tsconfig.spec.json').compilerOptions,
esModuleInterop: true,
allowSyntheticDefaultImports: true,
},
},
],
},
moduleNameMapper: {
'^lru-cache$': '<rootDir>/__mocks__/lru-cache.js',
...pathsToModuleNameMapper(compilerOptions.paths, {
prefix: '<rootDir>/../../',
}),
},
};