-
Notifications
You must be signed in to change notification settings - Fork 67
/
Copy pathjest.config.js
33 lines (33 loc) · 1.15 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
/**
* @see https://jestjs.io/docs/configuration
* @type {import("jest").Config}
*/
module.exports = {
testEnvironment: 'jsdom',
setupFilesAfterEnv: ['<rootDir>/src/shared/lib/test/setup.ts'],
moduleFileExtensions: ['ts', 'tsx', 'js', 'jsx', 'json'],
transform: {
'^.+\\.(ts|tsx|js|jsx)$': [
'babel-jest',
{ presets: ['@babel/preset-env', ['@babel/preset-react', { runtime: 'automatic' }], '@babel/preset-typescript'] },
],
},
globals: {
__API__: '',
},
moduleNameMapper: {
'^~app/(.*)$': '<rootDir>/src/app/$1',
'^~pages/(.*)$': '<rootDir>/src/pages/$1',
'^~widgets/(.*)$': '<rootDir>/src/widgets/$1',
'^~features/(.*)$': '<rootDir>/src/features/$1',
'^~entities/(.*)$': '<rootDir>/src/entities/$1',
'^~shared/(.*)$': '<rootDir>/src/shared/$1',
'\\.module\\.(css|scss)$': 'identity-obj-proxy',
'\\.svg$': '<rootDir>/src/shared/lib/test/__mocks__/svgMock.js',
},
testMatch: ['<rootDir>/src/**/*.{spec,test}.{ts,tsx,js,jsx}'],
collectCoverage: true,
collectCoverageFrom: ['src/**/*.{ts,tsx}', '!src/**/*.d.ts'],
coverageDirectory: '<rootDir>/coverage',
coverageReporters: ['text', 'lcov'],
};