forked from doriansmiley/x-reason
-
Notifications
You must be signed in to change notification settings - Fork 0
/
jest.config.ts
32 lines (24 loc) · 945 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
31
32
// jest.config.js
const nextJest = require('next/jest')
// Providing the path to your Next.js app which will enable loading next.config.js and .env files
const createJestConfig = nextJest({ dir: './' })
// Any custom config you want to pass to Jest
const customJestConfig = {
testEnvironment: 'node',
preset: 'ts-jest',
globals: {
'ts-jest': {
tsconfig: 'tsconfig.test.json',
},
},
testTimeout: 120000,
// Automatically clear mock calls and instances between every test
clearMocks: true,
// A list of paths to modules that run some code to configure or set up the testing framework before each test
setupFilesAfterEnv: ['@testing-library/jest-dom', './jest.setup.js'],
moduleNameMapper: {
'src/(.*)': '<rootDir>/src/$1',
},
}
// createJestConfig is exported in this way to ensure that next/jest can load the Next.js configuration, which is async
module.exports = createJestConfig(customJestConfig)