-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathjest.config.js
More file actions
28 lines (25 loc) · 912 Bytes
/
Copy pathjest.config.js
File metadata and controls
28 lines (25 loc) · 912 Bytes
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
// eslint-disable-next-line @typescript-eslint/no-var-requires
const nextJest = require('next/jest');
const createJestConfig = nextJest({ dir: '.' });
const customJestConfig = {
clearMocks: true,
moduleDirectories: ['node_modules', 'src'],
globals: {
'ts-jest': {
tsConfigFile: 'tsconfig.json',
enableTsDiagnostics: true,
},
},
moduleNameMapper: {
'^@/components/(.*)$': '<rootDir>/src/components/$1',
'^@/hooks/(.*)$': '<rootDir>/src/hooks/$1',
'^@/config/(.*)$': '<rootDir>/src/config/$1',
'^@/provider/(.*)$': '<rootDir>/src/providers/$1',
'^@/utils/(.*)$': '<rootDir>/utils/$1',
},
testRegex: '(/__tests__/.*|(\\.|/)test)\\.[jt]sx?$',
testEnvironment: 'jsdom',
testPathIgnorePatterns: ['<rootDir>/node_modules/', '<rootDir>/.next/'],
setupFilesAfterEnv: ['<rootDir>/utils/setupTests.ts'],
};
module.exports = createJestConfig(customJestConfig);