# Tests

> Supacharger comes with some database unit tests, which can be found in the [tests/database](https://github.com/glowplugstudio/supacharger/tree/main/supabase/tests/database) directory.

# Tests

## Database tests

Supacharger comes with some database unit tests, which can be found in the [tests/database](https://github.com/glowplugstudio/supacharger/tree/main/supabase/tests/database) directory.

To run them, use the following command:

```bash
pnpm test
```

## Bruno RPC collection

The Supacharger repository includes a CLI-managed Bruno collection and checker at `docs/bruno/supacharger-rpc/` and `scripts/check-bruno-rpc-parity.mjs`. Managed applications receive byte-identical copies. The collection uses local environment placeholders for the Supabase URL, publishable key, and user access token.

Run the parity check whenever an RPC migration changes:

```bash
npm run check:bruno-rpcs
```

In Core, the check fails when a current `api` RPC lacks a request or a request refers to a removed RPC. In a consumer, it requires every canonical Supacharger RPC while allowing additional product-owned RPCs. Product functions stay in the application's own collection. Privileged `api_edge` functions remain excluded so the shared collection never encourages storing service-role credentials.
