# pgTAP helpers

> tests.create_user, tests.authenticate_as and catalog checks (every_table_has_rls, policies_use, no_anon_policies, every_table_audited, partitions_have_rls) for `supabase test db`. Written to supabase/tests, never to your schema.

- Category: Database primitives
- Module: `pgtap`
- Modes: `managed`
- Docs: https://bettersupabase.com/docs/blocks/pgtap
- Page: https://bettersupabase.com/blocks/pgtap

## Install

```bash
npx better-supabase add pgtap
```

## Configure

Add the block to `better-supabase.config.ts`:

```ts
import { defineConfig } from "better-supabase/config";

export default defineConfig({
  blocks: {
    // Modes: "managed". The default is "managed".
    pgtap: { mode: "managed" },
  },
});
```

## Client

The block is SQL only: call its functions from your policies, RPCs and the other modules.
