-
Notifications
You must be signed in to change notification settings - Fork 8
/
Copy pathjest.config.ts
31 lines (28 loc) · 1.03 KB
/
jest.config.ts
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
import type { JestConfigWithTsJest } from 'ts-jest';
import { pathsToModuleNameMapper } from 'ts-jest';
import { compilerOptions } from './tsconfig.json';
const jestConfig: JestConfigWithTsJest = {
preset: 'ts-jest/presets/js-with-babel',
clearMocks: true,
collectCoverage: false,
collectCoverageFrom: [
'src/**/*.{js,ts}',
'!<rootDir>/src/**/*.d.{js,jsx,ts,tsx}',
'!<rootDir>/src/**/*mock*.{js,jsx,ts,tsx}',
'!<rootDir>/**/stories.{js,jsx,ts,tsx}',
'!<rootDir>/node_modules/',
],
coverageDirectory: 'coverage',
coverageProvider: 'v8',
testTimeout: 30000,
globalSetup: '<rootDir>/__test__/globalSetup.ts',
globalTeardown: '<rootDir>/__test__/globalTeardown.ts',
testEnvironment: 'jest-environment-node',
verbose: true,
roots: ['<rootDir>'],
modulePaths: [compilerOptions.baseUrl],
moduleNameMapper: pathsToModuleNameMapper(compilerOptions.paths, { prefix: '<rootDir>/src' }),
watchPathIgnorePatterns: ['globalConfig'],
testPathIgnorePatterns: ['/node_modules/', '/coverage/', '/build/', '/dist/'],
};
export default jestConfig;