-
Notifications
You must be signed in to change notification settings - Fork 0
/
jest.config.ts
30 lines (27 loc) · 985 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
import nextJest from 'next/jest'
const createJestConfig = nextJest({
dir: './',
})
// Add custom config to be passed to Jest
const customJestConfig = {
setupFilesAfterEnv: ['./setupTests.ts'],
moduleDirectories: ['node_modules', '<rootDir>/'], // needed to work if using TypeScript with baseURL of root
moduleNameMapper: {
'^@/components/(.*)$': '<rootDir>/components/$1',
'^@/pages/(.*)$': '<rootDir>/pages/$1',
'^@/styles/(.*)$': '<rootDir>/styles/$1',
'^@/server/(.*)$': '<rootDir>/server/$1',
'^@/utils/(.*)$': '<rootDir>/utils/$1',
'^@/env/(.*)$': '<rootDir>/env/$1',
'^@/data/(.*)$': '<rootDir>/data/$1',
'^@/types/(.*)$': '<rootDir>/types/$1',
'^@/prisma/(.*)$': '<rootDir>/prisma/$1',
'^@/worker/(.*)$': '<rootDir>/worker/$1',
},
testEnvironment: 'jest-environment-jsdom',
modulePathIgnorePatterns: ['cypress'],
transform: {
'^.+\\.(ts|tsx)$': 'ts-jest',
},
}
module.exports = createJestConfig(customJestConfig)