forked from konstructio/console
-
Notifications
You must be signed in to change notification settings - Fork 0
/
jest.config.ts
35 lines (33 loc) · 957 Bytes
/
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
32
33
34
35
import type { Config } from '@jest/types';
const config: Config.InitialOptions = {
verbose: true,
preset: 'ts-jest',
moduleFileExtensions: ['js', 'json', 'tsx', 'ts'],
setupFilesAfterEnv: ['<rootDir>/tests/jest.setup.ts'],
transformIgnorePatterns: ['<rootDir>/node_modules/'],
coveragePathIgnorePatterns: [
'/node_modules/',
'/tests/',
'/assets/',
'./jest.config.ts',
'./storybook',
],
collectCoverageFrom: ['**/*.{ts,tsx}', '!**/*.d.{ts,tsx}', '!**/*.stories.{ts,tsx}'],
transform: {
'^.+\\.js$': 'babel-jest',
'^.+\\.(ts|tsx)?$': 'ts-jest',
'^.+\\.(jpg|jpeg|png|gif|svg|css|webp)$': '<rootDir>/tests/file-mock.ts',
},
moduleNameMapper: {
'tests/(.*)': '<rootDir>/tests/$1',
'uuid': require.resolve('uuid'),
},
testEnvironment: 'jsdom',
globals: {
'ts-jest': {
tsconfig: '<rootDir>/tests/tsconfig.test.json',
isolatedModules: true,
},
},
};
export default config;