generated from vekaev/next_boilerplate
-
Notifications
You must be signed in to change notification settings - Fork 1
/
jest.config.js
25 lines (22 loc) · 913 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
25
/* eslint-disable @typescript-eslint/no-var-requires */
const nextJest = require('next/jest');
const createJestConfig = nextJest({ dir: './' });
const customJestConfig = {
setupFiles: [
'<rootDir>/.jest/setEnvVars.js',
'<rootDir>/.jest/browserMocks.js',
],
setupFilesAfterEnv: ['<rootDir>/.jest/jest.setup.js'],
moduleNameMapper: {
'@utils/(.*)': '<rootDir>/client/src/utils/$1',
'@providers/(.*)': '<rootDir>/client/src/providers/$1',
'@features/(.*)': '<rootDir>/client/src/features/$1',
'@services/(.*)': '<rootDir>/client/src/services/$1',
'@components/(.*)': '<rootDir>/client/src/components/$1',
'@components': '<rootDir>/client/src/components',
'@hooks/(.*)': '<rootDir>/client/src/hooks/$1',
'@__mocks__/(.*)': '<rootDir>/client/src/__mocks__/$1',
},
testEnvironment: 'jest-environment-jsdom',
};
module.exports = createJestConfig(customJestConfig);