-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathjest.config.js
More file actions
27 lines (24 loc) · 900 Bytes
/
jest.config.js
File metadata and controls
27 lines (24 loc) · 900 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
const nextJest = require('next/jest')
const createJestConfig = nextJest({
dir: './'
})
const customJestConfig = {
setupFilesAfterEnv: ['<rootDir>/jest.setup.js'],
moduleDirectories: ['node_modules', '<rootDir>/'],
moduleNameMapper: {
'^@pages/(.*)$': '<rootDir>/pages/$1',
'^@components/(.*)$': '<rootDir>/components/$1',
'^@contexts/(.*)$': '<rootDir>/contexts/$1',
'^@hooks/(.*)$': '<rootDir>/hooks/$1',
'^@styles/(.*)$': '<rootDir>/styles/$1',
'^@helpers/(.*)$': '<rootDir>/helpers/$1',
'^@constants/(.*)$': '<rootDir>/constants/$1',
'^@lib/(.*)$': '<rootDir>/lib/$1',
'^@graphql/(.*)$': '<rootDir>/graphql/$1',
'^@config/(.*)$': '<rootDir>/config/$1',
'^@localTypes/(.*)$': '<rootDir>/types/$1',
'^@utils/(.*)$': '<rootDir>/utils/$1'
},
testEnvironment: 'jest-environment-jsdom'
}
module.exports = createJestConfig(customJestConfig)