Test Suite
We use Vitest for our unit and integration tests.Running Tests
To run the unit and integration tests:End-to-End Tests
Thetests/e2e/ directory contains true end-to-end tests that spawn the built server binary (dist/index.js) as a child process and speak the MCP protocol to it with a real client — exactly like Claude or Cursor do:
stdio.e2e.test.ts— initialize handshake,tools/list, prompts/resources listing, tool calls (get_started, unconfigured error paths), schema-validation errors, unknown tools.sse.e2e.test.ts— boots the server in HTTP/SSE mode (serve --transport=sse) and checks/healthplus session rejection.
HOME, no .env, no credentials), so they are deterministic and never touch real accounts.
Writing a Tool Test
When testing an SEO tool, focus on verifying the math and the filtering logic.Mocking Google Data
We prefer using mock data for standard unit tests to avoid hitting API rate limits during CI/CD. Checktests/mocks.ts for existing search performance mocks.
CI/CD Workflow
Every pull request triggers our GitHub Actions CI, which:- Installs dependencies.
- Builds the project.
- Runs the test suite.
- Generates a coverage report.
