20 lines
535 B
JavaScript
20 lines
535 B
JavaScript
const nextJest = require('next/jest');
|
|
|
|
const createJestConfig = nextJest({
|
|
dir: './', // Path to your Next.js app
|
|
});
|
|
|
|
const customJestConfig = {
|
|
setupFilesAfterEnv: ['<rootDir>/jest.setup.js'],
|
|
testEnvironment: 'jest-environment-jsdom',
|
|
moduleNameMapper: {
|
|
'^@/(.*)$': '<rootDir>/src/$1',
|
|
},
|
|
testPathIgnorePatterns: ['<rootDir>/node_modules/', '<rootDir>/.next/'],
|
|
transform: {
|
|
'^.+\\.(js|jsx|ts|tsx)$': ['babel-jest', { presets: ['next/babel'] }],
|
|
},
|
|
};
|
|
|
|
module.exports = createJestConfig(customJestConfig);
|