forked from uc-cdis/commons-frontend-app
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathjest.config.ts
32 lines (30 loc) · 907 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
import type { JestConfigWithTsJest } from 'ts-jest';
const jestConfig: JestConfigWithTsJest = {
preset: 'ts-jest',
rootDir: __dirname,
roots: ['<rootDir>/src'],
moduleNameMapper: {
'^@/components(.*)$': '<rootDir>/src/components/$1',
'^@/lib/(.*)$': '<rootDir>/src/lib/$1',
'^redux-persist/lib/storage/createWebStorage$':
'<rootDir>/__mocks__/createWebStorageMock.js',
},
testEnvironment: 'jest-fixed-jsdom',
setupFilesAfterEnv: ['<rootDir>/jest.setup.ts'],
transform: {
'^.+\\.(ts|tsx)?$': [
'ts-jest',
{
isolatedModules: true,
tsconfig: 'tsconfig.test.json',
},
],
'node_modules/(flat|jsonpath-plus|uuid)/.+\\.(j|t)sx?$': ['ts-jest', {}],
},
transformIgnorePatterns: ['/node_modules/(?!(flat|jsonpath-plus|uuid))'],
modulePaths: ['<rootDir>'],
globals: {
fetch: global.fetch,
},
};
export default jestConfig;