# Testing During Development (/docs/development/testing)

## Local Unit Tests

Before submitting your updates, verify they pass all unit tests. Follow these steps to run tests locally:

- Copy your `.env.example` file in the `/api` folder and rename it to `.env`
  ```bash filename="create a /api/.env file"
  cp .env.example ./api/.env
  ```

- Add `NODE_ENV=CI` to your `/api/.env` file
- `npm run test:client`
- `npm run test:api`

### Running Tests Per-Workspace

Tests are run using Jest from their respective workspace directories. Target specific test files with patterns:

```bash
cd api && npx jest <pattern>
cd packages/api && npx jest <pattern>
cd client && npx jest <pattern>
```

<Callout type="tip" title="Tip">
  Use `test/layout-test-utils` for rendering components in frontend tests. Cover loading, success, and error states for UI/data flows.
</Callout>
