forked from SELISEdigitalplatforms/blocks-construct-react
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathjest.config.ts
More file actions
52 lines (50 loc) · 1.55 KB
/
jest.config.ts
File metadata and controls
52 lines (50 loc) · 1.55 KB
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
40
41
42
43
44
45
46
47
48
49
50
51
52
import type { Config } from 'jest';
const config: Config = {
preset: 'ts-jest',
testEnvironment: 'jsdom',
setupFiles: ['<rootDir>/jest.env.js'],
setupFilesAfterEnv: ['<rootDir>/jest.setup.ts'],
moduleNameMapper: {
'\\.(jpg|jpeg|png|gif|webp|svg)$': '<rootDir>/__mocks__/file-mocks.js',
'\\.css$': 'identity-obj-proxy',
'^/(.*)$': '<rootDir>/src/$1',
'^assets/(.*)$': '<rootDir>/src/assets/$1',
'^components/(.*)$': '<rootDir>/src/components/$1',
'^pages/(.*)$': '<rootDir>/src/pages/$1',
'^features/(.*)$': '<rootDir>/src/features/$1',
'^hooks/(.*)$': '<rootDir>/src/hooks/$1',
'^lib/(.*)$': '<rootDir>/src/lib/$1',
'^constant/(.*)$': '<rootDir>/src/constant/$1',
'^config/(.*)$': '<rootDir>/src/config/$1',
'^state/(.*)$': '<rootDir>/src/state/$1',
'^styles/(.*)$': '<rootDir>/src/styles/$1',
'^providers/(.*)$': '<rootDir>/src/providers/$1',
},
testMatch: ['**/*.spec.{ts,tsx}'],
collectCoverage: true,
coverageProvider: 'v8',
coverageReporters: ['lcov', 'text'],
coverageDirectory: 'coverage',
collectCoverageFrom: [
'src/**/*.{ts,tsx}',
'!src/**/*.spec.{ts,tsx}',
'!src/**/*.test.{ts,tsx}',
'!src/**/*.model.ts',
'!src/**/*.module.ts',
'!src/**/*.d.ts',
'!**/node_modules/**',
],
transform: {
'^.+\\.(t|j)sx?$': [
'ts-jest',
{
tsconfig: './tsconfig.jest.json',
isolatedModules: true,
esModuleInterop: true,
allowJs: true,
},
],
},
transformIgnorePatterns: ['node_modules/(?!(uuid)/)'],
};
export default config;