-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathjest.config.ts
25 lines (22 loc) · 932 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
import type { Config } from 'jest';
import nextJest from 'next/jest.js';
/** @type {import('jest').Config} */
const createJestConfig = nextJest({
// Provide the path to your Next.js app to load next.config.js and .env files in your test environment
dir: './',
});
// Add any custom config to be passed to Jest
const config: Config = {
testEnvironment: './jsdom-extended.js',
testEnvironmentOptions: {
customExportConditions: [''],
},
moduleDirectories: ['node_modules', 'src'],
setupFilesAfterEnv: ['<rootDir>/src/setupTests.ts'],
moduleNameMapper: {
'\\.(jpg|jpeg|png|gif|eot|otf|webp|svg|ttf|woff|woff2|mp4|webm|wav|mp3|m4a|aac|oga|md)$': 'identity-obj-proxy',
'\\.(css|less|sass|scss)$': 'identity-obj-proxy',
},
};
// createJestConfig is exported this way to ensure that next/jest can load the Next.js config which is async
export default createJestConfig(config);