-
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathjest.config.js
29 lines (29 loc) · 914 Bytes
/
jest.config.js
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 esModules = require('./esModules');
const { join } = require('path');
module.exports = {
preset: 'ts-jest',
prettierPath: require.resolve('prettier-2'),
testEnvironment: 'node',
testMatch: ['**/__tests__/**/*.spec.ts'],
transform: {
'^.+\\.(js|jsx|ts|tsx|mjs|cjs)$': ['ts-jest',{
tsconfig: './tsconfig.json',
isolatedModules: true,
}]
},
collectCoverageFrom: [
'<rootDir>/src/**/*.ts',
'!<rootDir>/src/__tests__/**/*.ts',
'!<rootDir>/src/types/**/*.ts',
'!<rootDir>/src/cli.ts',
],
collectCoverage: true,
transformIgnorePatterns: [
`node_modules/(?!.pnpm)(?!(${esModules.join('|')})/)`,
],
moduleNameMapper: {
// Force module unicorn-magic to resolve with the CJS entry point, because Jest does not support package.json.exports
"unicorn-magic": require.resolve('unicorn-magic'),
"prettier": require.resolve('prettier-2'),
},
};