Overview
Thesunpeak test command runs automated tests for your MCP server. It supports unit tests, E2E tests against the inspector, visual regression, live tests against real hosts, and multi-model evals.
sunpeak test runs unit tests (Vitest) and E2E tests (Playwright). Live tests and evals are never included in the default run because they require API keys and cost money.
Options
| Flag | Description |
|---|---|
--unit | Run unit tests only (Vitest + happy-dom) |
--e2e | Run E2E tests only (Playwright + inspector) |
--visual | Run E2E tests with visual regression comparison |
--visual --update | Update visual regression baselines |
--live | Run live tests against real hosts (ChatGPT) |
--eval | Run evals against multiple LLM models |
--unit --e2e --live --eval runs all four. --visual implies --e2e. --update implies --visual.
Extra arguments are passed through to the underlying test runner (Playwright or Vitest):
Subcommands
sunpeak test init
Scaffold test infrastructure for an existing MCP server (not built with sunpeak):
tests/e2e/with example Playwright specs and configtests/simulations/with example simulation JSON fixturestests/evals/with eval config,.env.example, and example eval specstests/live/with live test config and example specs
sunpeak new scaffolds all of this automatically.
Examples
See Also
Unit Testing
Fast component and hook tests with Vitest.
E2E Testing
Write Playwright tests against simulated hosts.
Visual Regression
Screenshot comparison and baseline management.
Live Testing
Test against real ChatGPT.
Evals
Multi-model tool calling tests.