-
Notifications
You must be signed in to change notification settings - Fork 6.1k
/
jest.config.mjs
22 lines (19 loc) · 726 Bytes
/
jest.config.mjs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
import nextJest from 'next/jest.js';
const createJestConfig = nextJest({
dir: './',
});
/** @type {import('jest').Config} */
const customJestConfig = {
setupFilesAfterEnv: ['<rootDir>/jest.setup.mjs'],
moduleDirectories: ['node_modules', '<rootDir>/'],
testEnvironment: 'jest-environment-jsdom',
testMatch: ['**/__tests__/*.test.mjs'],
coverageReporters: ['json', 'json-summary'],
reporters: ['default', 'jest-junit'],
moduleNameMapper: {
'next/router': '<rootDir>/components/__mocks__/next-router.mjs',
'next-intl': '<rootDir>/components/__mocks__/next-intl.mjs',
'github-slugger': '<rootDir>/components/__mocks__/github-slugger.mjs',
},
};
export default createJestConfig(customJestConfig);