2.2 KiB
Integration Repair Brief
Project: helpyourneighbour
Failure Signal
backend@1.0.0 test:integration node scripts/integration-test.mjs
/home/openclaw/.openclaw/workspace/helpyourneighbour/backend/node_modules/playwright/lib/common/testType.js:75 throw new Error([ ^
Error: Playwright Test did not expect test() to be called here. Most common reasons include:
- You are calling test() in a configuration file.
- You are calling test() in a file that is imported by the configuration file.
- You have two different versions of @playwright/test. This usually happens when one of the dependencies in your package.json depends on @playwright/test. at TestTypeImpl._currentSuite (/home/openclaw/.openclaw/workspace/helpyourneighbour/backend/node_modules/playwright/lib/common/testType.js:75:13) at TestTypeImpl._createTest (/home/openclaw/.openclaw/workspace/helpyourneighbour/backend/node_modules/playwright/lib/common/testType.js:88:24) at /home/openclaw/.openclaw/workspace/helpyourneighbour/backend/node_modules/playwright/lib/transform/transform.js:282:12 at file:///home/openclaw/.openclaw/workspace/helpyourneighbour/backend/scripts/integration-test.mjs:3:1 at ModuleJob.run (node:internal/modules/esm/module_job:343:25) at async onImport.tracePromise.proto (node:internal/modules/esm/loader:665:26) at async asyncRunEntryPointWithESMLoader (node:internal/modules/run_main:117:5)
Node.js v22.22.0
Integration Runner
import { test, expect } from '@playwright/test';
test('API server starts and returns 200', async ({ page }) => { await page.goto('http://localhost:3000/api/health'); await expect(page.status()).toBe(200); });
Playwright Config
const { devices } = require('@playwright/test');
/** @type {import('@playwright/test').PlaywrightTestConfig} */ const config = { testDir: './scripts', timeout: 30000, fullyParallel: true, forbidOnly: !!process.env.CI, retries: process.env.CI ? 2 : 0, workers: process.env.CI ? 1 : undefined, reporter: 'html', use: { actionTimeout: 0, baseURL: 'http://localhost:3000', trace: 'on-first-retry', }, projects: [ { name: 'chromium', use: { ...devices['Desktop Chrome'] }, }, ], };
module.exports = config;