28 lines
1.0 KiB
JavaScript
Executable File
28 lines
1.0 KiB
JavaScript
Executable File
const nextJest = require('next/jest')
|
|
|
|
const createJestConfig = nextJest({
|
|
// Provide the path to your Next.js app to load next.config.js and .env files
|
|
dir: './',
|
|
})
|
|
|
|
// Integration tests configuration - runs in Node.js environment with fetch polyfill
|
|
const integrationJestConfig = {
|
|
displayName: 'Integration Tests',
|
|
setupFilesAfterEnv: ['<rootDir>/jest.setup.integration.js'],
|
|
moduleNameMapper: {
|
|
// Handle module aliases
|
|
'^@/(.*)$': '<rootDir>/src/$1',
|
|
},
|
|
testEnvironment: 'node', // Node.js environment for real HTTP calls
|
|
testMatch: [
|
|
'<rootDir>/src/__tests__/integration.test.ts',
|
|
'<rootDir>/src/__tests__/e2e-docker.test.ts'
|
|
],
|
|
testTimeout: 30000, // Longer timeout for integration tests
|
|
globalSetup: '<rootDir>/jest.globalSetup.integration.js',
|
|
globalTeardown: '<rootDir>/jest.globalTeardown.integration.js'
|
|
}
|
|
|
|
// createJestConfig is exported this way to ensure that next/jest can load the Next.js config which is async
|
|
module.exports = createJestConfig(integrationJestConfig)
|