forked from mui/toolpad
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathjest.config.ts
28 lines (23 loc) · 877 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
import type { Config } from '@jest/types';
import nextJest from 'next/jest';
const createJestConfig = nextJest({
// Provide the path to your Next.js app to load next.config.js and .env files in your test environment
dir: '<rootDir>/packages/toolpad-app',
});
export default async function createConfig() {
const nextJestConfig: Config.InitialOptions = await createJestConfig({
testEnvironment: 'jest-environment-jsdom',
})();
// Workaround, see https://github.com/vercel/next.js/issues/35634#issuecomment-1115250297
nextJestConfig.transformIgnorePatterns[0] = '/node_modules/(?!lodash-es)/';
const config: Config.InitialOptions = {
projects: [
{
testMatch: ['<rootDir>/packages/toolpad-app/**/*.spec.*'],
...nextJestConfig,
},
],
setupFilesAfterEnv: ['<rootDir>/test/utils/jest-setup.ts'],
};
return config;
}