---
url: https://kit.kambium.net/docs/integration-tests.md
description: Test app server routes, engine registration and task persistence.
---

# Integration tests

Use Vitest to check a server route or engine registration in-process. Kit's
test mode uses in-memory fakes and Fastify's `app.inject()` sends a request
without opening a port. The generated test needs no local Supabase, Redis or
provider credentials.

## Test a server route

From the generated app directory, run:

```sh
npm run test:server
```

The starter spec at `tests/server-integration/health.test.ts` boots Kit in test
mode and checks that `/health` returns HTTP 200 and the expected JSON. For an
engine or app route test, register the engine or plugin in this test app and
assert the response or state change your code owns.

The testing package reference shows how to [share server fixture setup](https://github.com/MartinMalinda/kambium/blob/main/packages/testing/README.md#server-integration-tests).

## Verify a real worker

Use `npm run local:check` to verify a task through the real local worker and read
back its saved result. The [local task check](https://kit.kambium.net/docs/tasks.md#optional-local-task-check)
shows how to adapt the generated check to an engine and which persisted state
to assert. Use [E2E tests](https://kit.kambium.net/docs/e2e-tests.md) for flows that cross the dashboard,
authentication or a provider simulator.
