mirror of
https://github.com/tiennm99/vigeoguessr.git
synced 2026-10-13 06:15:54 +00:00
23 lines
738 B
TypeScript
23 lines
738 B
TypeScript
import nextJest from 'next/jest'
|
|
import type { Config } from 'jest'
|
|
|
|
const createJestConfig = nextJest({
|
|
// Provide the path to your Next.js app to load next.config.js and .env files
|
|
dir: './',
|
|
})
|
|
|
|
// Add any custom config to be passed to Jest
|
|
const customJestConfig: Config = {
|
|
setupFilesAfterEnv: ['<rootDir>/jest.setup.ts'],
|
|
testEnvironment: 'jsdom',
|
|
testPathIgnorePatterns: ['/node_modules/', '/.next/'],
|
|
transform: {
|
|
'^.+\\.(js|jsx|ts|tsx)$': ['babel-jest', { presets: ['next/babel'] }],
|
|
},
|
|
moduleNameMapper: {
|
|
'^@/(.*)$': '<rootDir>/src/$1',
|
|
},
|
|
}
|
|
|
|
// createJestConfig is exported this way to ensure that next/jest can load the Next.js config which is async
|
|
export default createJestConfig(customJestConfig) |