-
Notifications
You must be signed in to change notification settings - Fork 6
/
Copy pathjest.config.js
39 lines (37 loc) · 1.52 KB
/
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
30
31
32
33
34
35
36
37
38
39
/** @format */
/* eslint @typescript-eslint/no-var-requires:0 */
// const { pathsToModuleNameMapper } = require('ts-jest/utils');
const { jsWithTs: tsjPreset } = require('ts-jest/presets');
// In the following statement, replace `./tsconfig` with the path to your `tsconfig` file
// which contains the path mapping (ie the `compilerOptions.paths` option):
// const { compilerOptions } = require('./tsconfig');
// const localPathMapper = pathsToModuleNameMapper(compilerOptions.paths, { prefix: '<rootDir>/' });
module.exports = {
testTimeout: 180000,
verbose: true,
preset: 'ts-jest',
testEnvironment: 'node',
setupFiles: ['./jest.setup.ts'],
globals: {
'ts-jest': {
tsconfig: 'tsconfig.jest.json',
// Disable type-checking
isolatedModules: true,
},
},
moduleFileExtensions: ['ts', 'tsx', 'js', 'jsx', 'json'],
moduleNameMapper: {
// ...localPathMapper,
// eslint-disable-next-line max-len
'\\.(jpg|ico|jpeg|png|gif|eot|otf|webp|svg|ttf|woff|woff2|mp4|webm|wav|mp3|m4a|aac|oga|css|scss|sass|less)(\\?.*)?$':
'<rootDir>/__mocks__/fileMock.js',
},
transform: {
...tsjPreset.transform,
'.+\\.(css|styl|less|sass|scss|png|jpg|ttf|woff|woff2)(\\?.*)?$': 'jest-transform-stub',
'^.+\\.svg$': 'jest-svg-transformer',
},
// transformIgnorePatterns: ['node_modules/(?!(simple-git/src))/'],
testMatch: ['**/__tests__/**/*.[jt]s?(x)', '**/(*.)+(spec|test).[jt]s?(x)'],
testPathIgnorePatterns: ['<rootDir>/.git/', '<rootDir>/dist/', '<rootDir>/node_modules/', '<rootDir>/.local/'],
};