-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathjest.config.js
24 lines (21 loc) · 845 Bytes
/
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
/* eslint-disable max-len */
const nextJest = require('next/jest');
const createJestConfig = nextJest({
dir: './',
});
// Add any custom config to be passed to Jest
const customJestConfig = {
setupFilesAfterEnv: ['@testing-library/jest-dom/extend-expect'],
testEnvironment: 'jest-environment-jsdom',
moduleNameMapper: {
'^@/components/(.*)$': '<rootDir>/src/components/$1',
'^@/features/(.*)$': '<rootDir>/src/features/$1',
'^@/hooks/(.*)$': '<rootDir>/src/hooks/$1',
'^@/lib/(.*)$': '<rootDir>/src/lib/$1',
'^@/types/(.*)$': '<rootDir>/src/types/$1',
'^@/utils/(.*)$': '<rootDir>/src/utils/$1',
'^@/pages/(.*)$': '<rootDir>/pages/$1',
},
};
// createJestConfig is exported this way to ensure that next/jest can load the Next.js config which is async
module.exports = createJestConfig(customJestConfig);