Unkey

Testing

James loves writing tests

We use vitest for our unit and integration tests. You can run the tests with:

pnpm install
pnpm test

API Tests

/apps/api is our core product and needs to be heavily tested. Unit tests are not enough so we also use integration tests:

integration

Full end to end tests require a running API either locally or in a deployed environment.

cd apps/api
 
UNKEY_BASE_URL=
UNKEY_ROOT_KEY=
pnpm test:integration

Clickhouse Tests

/internal/clickhouse is where we store our ClickHouse queries. To run tests locally, please install goose.

To install goose:

go install github.com/pressly/goose/v4/cmd/goose@latest

Last updated on

On this page