> ## Documentation Index
> Fetch the complete documentation index at: https://docs.whilst.io/llms.txt
> Use this file to discover all available pages before exploring further.

# Testing

> Test strategy and commands

## Running Tests

```bash theme={null}
# Run all tests (builds first)
pnpm test

# Run tests for a specific package
pnpm --filter @whilst/tenant-store test
pnpm --filter @whilst/web-app test

# Run with coverage
pnpm --filter @whilst/tenant-store test -- --coverage
```

## Test Framework

Whilst uses [Vitest](https://vitest.dev/) for unit and integration tests. Each package has its own `vitest.config.ts`.

## Linting & Type Checking

```bash theme={null}
# Lint all packages
pnpm lint

# Type check all packages
pnpm typecheck

# Format code
pnpm format
```

## Pre-Push Checklist

Before pushing changes:

1. `pnpm typecheck` — must pass with zero errors
2. `pnpm build` — if you changed build-time code
3. `pnpm test` — all tests pass
4. `pnpm lint` — no lint errors
5. Update `/CHANGELOG.md` with your changes

## E2E Tests

End-to-end tests use [Playwright](https://playwright.dev/):

```bash theme={null}
# Run Playwright tests
npx playwright test

# Run with UI mode
npx playwright test --ui

# View test report
npx playwright show-report
```

Configuration is in `playwright.config.ts` at the project root.
