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

# Testing and readiness

> Comprehensive documentation for testing and readiness in KilatKoding, including env checks, health checks, lint, typecheck, Playwright, and CI.

<Info>
  This is not a user-facing product feature, but it is essential for keeping setup, custom work, and launch safe. This area helps the team verify that changes have not damaged application readiness.
</Info>

## What this feature includes

* `npm run env:check`
* `GET /api/health`
* `npm run lint`
* `npm run typecheck`
* `npm test`
* Playwright
* GitHub Actions CI

## Related routes, endpoints, and commands

| Path or command      | Type     | Purpose                                                                    |
| -------------------- | -------- | -------------------------------------------------------------------------- |
| `GET /api/health`    | Endpoint | Health check for configuration and database readiness                      |
| `npm run env:check`  | Command  | Checks env completeness and consistency by reading `.env` and `.env.local` |
| `npm run lint`       | Command  | Runs lint checks                                                           |
| `npm run typecheck`  | Command  | Runs the TypeScript check                                                  |
| `npm test`           | Command  | Runs the Vitest suite                                                      |
| `npm run e2e`        | Command  | Runs Playwright end-to-end tests                                           |
| `npm run e2e:headed` | Command  | Runs Playwright in headed mode                                             |

<Note>
  Because `npm run env:check` now loads env files from the working directory using the same pattern as Next.js, its output is usually closer to the behavior of the running dev server.
</Note>

## Main dependencies

| Item                       | Required?                         | Notes                                     |
| -------------------------- | --------------------------------- | ----------------------------------------- |
| Correct env values         | Yes                               | Many readiness checks depend on env state |
| Playwright browser install | Depends                           | Needed for E2E                            |
| Test base URL              | Depends                           | Important for Playwright                  |
| CI pipeline                | Optional but strongly recommended | Helps preserve quality before deployment  |

## What teams usually customize

* smoke tests,
* staging URLs,
* test data,
* internal QA flow,
* the threshold for “ready to deploy.”

## When this feature matters most

* before launch,
* after large custom work,
* during handoff to another developer or client,
* when bugs appear in staging or production.

## Verification checklist

1. After changing env values, restart the dev server and make sure `npm run env:check` does not show unintentionally active fallback states.
2. `GET /api/health` matches expectations.
3. `npm run lint` passes.
4. `npm run typecheck` passes.
5. `npm test` passes.
6. Playwright passes at least the most important core flow.

<Tip>
  If you are preparing a launch, continue to [Launch checklists](/en/kilatkoding/launch-checklists) and [Testing recipes](/en/kilatkoding/testing-recipes).
</Tip>
