CI Pipeline with Test Management / 🧪 Run Tests & Generate Reports (push) Canceled after 0s
Test Reporting & Gherkin Analysis / 🧪 Run Tests & Generate Reports (push) Canceled after 0s
CI Pipeline with Test Management / 🐳 Docker Integration Tests (push) Canceled after 0s
CI Pipeline with Test Management / 🏗️ Build Docker Image (push) Canceled after 0s
CI Pipeline with Test Management / 📊 Generate Test Summary (push) Canceled after 0s
Test Reporting & Gherkin Analysis / 📊 Analyze Test Coverage (push) Canceled after 0s
Test Reporting & Gherkin Analysis / 🔄 Sync with Linear (push) Canceled after 0s
Test Reporting & Gherkin Analysis / ⚡ Performance Monitoring (push) Canceled after 0s
The Payload CLI failed with ERR_REQUIRE_ASYNC_MODULE on Node 22 and 26 alike: without "type": "module" it loaded payload.config.ts as CommonJS and could not require the top-level-await ESM @payloadcms/richtext-lexical. Following the official Payload template: "type": "module", CommonJS jest files and the content schema renamed to .cjs, ESLint globs updated. Next's standalone server.js is ESM and starts; 516 unit tests, tsc, lint and build are green. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
38 lines
1.1 KiB
JavaScript
Executable File
38 lines
1.1 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: './',
|
|
})
|
|
|
|
// Unit tests configuration - runs in Node.js environment
|
|
const unitJestConfig = {
|
|
displayName: 'Unit Tests',
|
|
setupFilesAfterEnv: ['<rootDir>/jest.setup.cjs'],
|
|
moduleNameMapper: {
|
|
// Handle module aliases
|
|
'^@/(.*)$': '<rootDir>/src/$1',
|
|
},
|
|
testEnvironment: 'jest-environment-jsdom',
|
|
collectCoverageFrom: [
|
|
'src/**/*.{js,jsx,ts,tsx}',
|
|
'!src/**/index.ts',
|
|
'!src/**/*.d.ts',
|
|
'!src/__tests__/**',
|
|
],
|
|
testPathIgnorePatterns: [
|
|
'<rootDir>/.next/',
|
|
'<rootDir>/node_modules/',
|
|
'<rootDir>/src/__tests__/integration.test.ts',
|
|
'<rootDir>/src/__tests__/e2e-docker.test.ts',
|
|
'<rootDir>/src/__tests__/browser-integration.test.ts'
|
|
],
|
|
testMatch: [
|
|
'<rootDir>/src/**/*.test.{js,jsx,ts,tsx}',
|
|
'<rootDir>/src/**/*.unit.test.{js,jsx,ts,tsx}'
|
|
]
|
|
}
|
|
|
|
// createJestConfig is exported this way to ensure that next/jest can load the Next.js config which is async
|
|
module.exports = createJestConfig(unitJestConfig)
|