build(proto): mark the package as ESM so the Payload CLI loads the config (MITHOME-136)
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
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>
This commit is contained in:
co-authored by
Claude Opus 5.5
parent
66b169cf06
commit
a3d6cbe404
Executable
+50
@@ -0,0 +1,50 @@
|
||||
// Global setup for integration tests
|
||||
module.exports = async () => {
|
||||
console.log('🔧 Setting up integration test environment...')
|
||||
|
||||
// Wait for Docker services to be ready
|
||||
const maxWaitTime = 60000 // 1 minute
|
||||
const checkInterval = 2000 // 2 seconds
|
||||
let waitTime = 0
|
||||
|
||||
const checkServices = async () => {
|
||||
try {
|
||||
const { fetch } = require('undici')
|
||||
|
||||
// Check if Next.js app is ready
|
||||
const response = await fetch('http://localhost:3000/api/health', {
|
||||
timeout: 5000
|
||||
})
|
||||
|
||||
if (response.ok) {
|
||||
console.log('✅ Docker services are ready!')
|
||||
return true
|
||||
}
|
||||
} catch (error) {
|
||||
// Services not ready yet
|
||||
}
|
||||
return false
|
||||
}
|
||||
|
||||
// Only check services if INTEGRATION_TESTS is enabled
|
||||
if (process.env.INTEGRATION_TESTS === '1' || process.env.E2E_TESTS === '1') {
|
||||
console.log('⏳ Waiting for Docker services to be ready...')
|
||||
|
||||
while (waitTime < maxWaitTime) {
|
||||
if (await checkServices()) {
|
||||
break
|
||||
}
|
||||
|
||||
await new Promise(resolve => setTimeout(resolve, checkInterval))
|
||||
waitTime += checkInterval
|
||||
|
||||
if (waitTime % 10000 === 0) {
|
||||
console.log(`⏳ Still waiting... (${waitTime / 1000}s elapsed)`)
|
||||
}
|
||||
}
|
||||
|
||||
if (waitTime >= maxWaitTime) {
|
||||
console.warn('⚠️ Docker services may not be fully ready. Tests might fail.')
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user