-
Notifications
You must be signed in to change notification settings - Fork 2
/
jest.config.ts
36 lines (34 loc) · 944 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
36
import type { Config } from '@jest/types';
// Sync object
const config: Config.InitialOptions = {
collectCoverageFrom: [
'src/**/*.{js,jsx,ts,tsx}',
'!**/*.d.ts',
'!**/node_modules/**',
'!**/.next/**',
],
moduleNameMapper: {
'^@app(.*)$': '<rootDir>/src$1',
'^@common(.*)$': '<rootDir>/../common-ui$1',
'^axios$': require.resolve('axios'),
},
moduleDirectories: [
'node_modules',
'src',
'<rootDir>/../common-ui/node_modules',
'<rootDir>/../common-ui',
],
testPathIgnorePatterns: ['<rootDir>/node_modules/', '<rootDir>/.next/'],
testEnvironment: 'jsdom',
transform: {
'^.+\\.(js|jsx|ts|tsx)$': ['babel-jest', { presets: ['next/babel'] }],
},
transformIgnorePatterns: [
'/node_modules/',
'^.+\\.module\\.(css|sass|scss)$',
],
setupFilesAfterEnv: ['./jest.setup.ts'],
testResultsProcessor: 'jest-junit',
coverageReporters: ['html'],
};
export default config;