Skip to content

Gotchas

All test files share one backend and one database, and each resets it in beforeAll. In parallel they would wipe each other’s data. The template already sets this in vitest.config.ts; with your own config add it yourself:

export default defineConfig({
test: {
fileParallelism: false,
},
})

In test mode the client sends requests only to localhost, 127.0.0.1, [::1] and the hosts you list. Anything else throws EberlyUnsafeHostError in new World(), before the first request. Add a staging host if you need one; never production.

export const eberly = {
url: 'https://api.staging.example.com',
allowedHosts: ['*.staging.example.com'],
// …
} satisfies EberlyConfig

A test with a type error still runs. Run pnpm typecheck (tsc --noEmit) in CI, before pnpm test.

pnpm run client:generate after every change of the swagger, then pnpm typecheck.

Commit eberly/generated.ts and eberly/api/

Section titled “Commit eberly/generated.ts and eberly/api/”

Then a contract change shows up in the diff of a pull request.

Otherwise it is just number:

for (const s of [401, 403] as const) res.assert(s)

Privacy-friendly analytics, no cookies.