-
Notifications
You must be signed in to change notification settings - Fork 0
/
jest.config.js
25 lines (22 loc) · 957 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
/* eslint-disable @typescript-eslint/no-var-requires */
const { pathsToModuleNameMapper } = require('ts-jest/utils');
const { compilerOptions } = require('./tsconfig');
const pathIgnorePatterns = ['<rootDir>/.git/', '<rootDir>/.next/'];
const nodeModulesPattern = '<rootDir>/node_modules/';
const autoFixTempPattern = '/auto_fix_';
module.exports = {
preset: 'ts-jest/presets/js-with-babel',
testEnvironment: 'node',
setupFilesAfterEnv: ['./jest.setup.ts'],
testPathIgnorePatterns: [...pathIgnorePatterns, nodeModulesPattern, autoFixTempPattern],
timers: 'modern',
transformIgnorePatterns: [...pathIgnorePatterns, nodeModulesPattern],
watchPathIgnorePatterns: [...pathIgnorePatterns, nodeModulesPattern],
modulePathIgnorePatterns: pathIgnorePatterns,
moduleNameMapper: pathsToModuleNameMapper(compilerOptions.paths, { prefix: '<rootDir>/' }),
globals: {
'ts-jest': {
tsConfig: '<rootDir>/tsconfig-jest.json',
},
},
};