---
title: "Testing"
description: "Run EdgeCart's unit, integration, and plugin CLI test suites."
---

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

# Testing

EdgeCart tests run inside the real Workers runtime with real D1 bindings, using
Cloudflare's Vitest integration.

## Commands

```sh
pnpm test              # unit tests (tests/unit)
pnpm test:integration  # service + HTTP flows on real D1 (tests/integration)
pnpm test:cli          # plugin CLI tests
pnpm test:all          # all three suites
```

Run the full suite before opening a pull request that changes shared commerce
behavior.

## How the suites work

- **Unit** (`vitest.unit.config.mts`) — pure functions: money and tax rounding,
  pricing rules, promotions, metadata, IDs, pagination, ISO 3166.
- **Integration** (`vitest.workers.config.mts`) — drives real HTTP routes through
  the Hono app, queue handlers, cron handlers, and Stripe webhook signature
  verification. The real D1 schema is applied per test file and truncated
  between tests.
- **CLI** — validates the plugin CLI's `keygen`, `validate`, and `publish`
  behavior.

## CI

The repository CI runs typechecks, both Workers suites, the plugin CLI suite,
Drizzle migration drift checks, and a production build.

## Related

- [Local development](https://edgecart.dev/developers/local-development)
- [Deployment](https://edgecart.dev/developers/deployment)
- [API conventions](https://edgecart.dev/reference/api-conventions)

Source: https://edgecart.dev/developers/testing/index.mdx
