Test framework

The project uses Vitest for unit and integration testing with support for coverage reports and an interactive UI.

Run tests

# Run all tests
npm test

# Run tests once
npm run test -- --run

# Watch mode (default)
npm run test

Coverage reports

Generate code coverage reports:
npm run test:coverage
Coverage reports are generated in the coverage/ directory with HTML, JSON, and lcov formats.

Test UI

Run tests with an interactive browser UI:
npm run test:ui
This launches Vitest’s UI interface at http://localhost:51204/__vitest__/ where you can:
  • View test results in real-time
  • Filter tests by file, status, or text
  • See code coverage highlighted in source
  • Re-run individual tests

Reliability checks

The project includes a comprehensive reliability suite that verifies:
  • Server health endpoints
  • Session lifecycle (start/end)
  • Navigation and content extraction
  • Multi-tab workflows
  • Repeatable execution
Run the full reliability suite:
# Against default endpoint
npm run reliability:check

# Against custom endpoint
npm run reliability:check -- http://localhost:3100/mcp
The reliability script runs a deterministic sequence of tool calls and validates results.

What gets tested in CI

The GitHub Actions CI workflow (.github/workflows/ci.yml) runs:
  • npm ci — clean dependency install
  • npm run typecheck — TypeScript type checking
  • npm run lint — ESLint code quality
  • npm run format:check — Prettier formatting
  • npm test — 127 Vitest tests across 6 test files
CI runs on Node.js 20, 22, and 24 via GitHub Actions matrix.

Test files

Test files are located alongside source files with .test.ts extension:
  • src/session.test.ts — session management tests
  • src/tools/__tests__/index.test.ts — MCP tool tests
  • src/scripts/codingStyle.test.ts — coding style compliance
  • src/scripts/format.test.ts — Prettier formatting checks
  • src/scripts/lint.test.ts — ESLint linting checks
  • src/scripts/typecheck.test.ts — TypeScript type safety checks

Adding tests

When adding new tools or features, include tests:
import { describe, it, expect } from 'vitest';

describe('my feature', () => {
  it('should work correctly', async () => {
    const result = await myFunction();
    expect(result).toBe('expected');
  });
});

Debugging tests

For debugging, use the Vitest UI or add .only to focus on a specific test:
it.only('this test runs alone', async () => {
  // ...
});

CI test environment

CI runs on Ubuntu with Node.js 20, 22, and 24 using GitHub Actions.