Your test stops while Playwright reads the config. Open the first file from your project in the stack trace. If the config imports a test file, remove that import. Put any settings both files need in a module that declares no tests. Then run:
npx playwright test --list
Playwright Test did not expect test() to be called here.
Our config imported tests/cart.spec.ts. Importing it ran its top-level test() while Playwright was still reading settings. The runner printed:
Error: Playwright Test did not expect test() to be called here.
Once we removed the import, Playwright found the same test during collection. Collection is the step where the runner loads test files and records their test names.
A helper loads another copy of Playwright Test
If the stack points into a helper package, run npm ls @playwright/test. Our project used 1.65.0. A helper that declared tests loaded its own copy, 1.64.0. In the helper's package.json, we moved @playwright/test from dependencies to peerDependencies and allowed 1.65.0. The helper then shared the project's runner, and its test passed.
Playwright Test did not expect test.describe() to be called here.
Our config called test.describe() and the error named that function instead. Move the group into a test file. Keep the group callback synchronous. In another run, declaring a test after an await in that callback produced the test() error. Put awaited work inside the test or a setup hook.
We checked Playwright Test 1.65.0 on macOS 15.4.1 and Debian 12 on 10 November 2026. The config import failed in JavaScript and TypeScript with CI=1 and with CI unset.
References: Playwright configuration and declaring tests and groups.