# kindgi test

> Run the pack's tests via vitest

## `kindgi test`

**Synopsis**

```sh signature
kindgi test [--watch] [--reporter <name>] [--path <dir>] [-- <vitest-args>...]
```

Run the pack's tests via vitest. Ergonomic wrapper over `vitest run`.

**Options**

| Option               | Default               | Description                                                                                                                                       |
| -------------------- | --------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- |
| `--path <value>`     | the current directory | The pack root, with a `kindgi.config.*` and a `vitest.config.*` (`.ts`, `.mts`, `.cts`, `.js`, `.mjs` or `.cjs`). Default: the current directory. |
| `--reporter <value>` | vitest's own reporter | The vitest reporter to use (vitest's `--reporter`), e.g. `verbose` or `json`.                                                                     |
| `--watch`            | off                   | Run vitest in watch mode. By default the tests run once (`vitest run`).                                                                           |

Every command also takes the [global flags](https://docs.kindgi.com/v0.1.8/reference/cli.md#global-flags).

**Examples**

From [Write a guardrail](https://docs.kindgi.com/v0.1.8/guides/guardrails/write-a-guardrail.md):

```sh
pnpm exec kindgi test
```

**See also**

- [Write a guardrail](https://docs.kindgi.com/v0.1.8/guides/guardrails/write-a-guardrail.md)
- [Write a tool](https://docs.kindgi.com/v0.1.8/guides/tools/write-a-tool.md)
- [Add Kindgi to a TypeScript or Node app](https://docs.kindgi.com/v0.1.8/start/existing-app-typescript.md)
