Skip to main content

Testing Guide

Quick Commands

Test Structure

Unit Testing

Swift (XCTest)

TypeScript (Vitest)

Integration Testing

API Testing

WebSocket Testing

E2E Testing

Playwright Setup

E2E Tests

Performance Testing

Load Testing

Benchmark Suite

Test Coverage

Coverage Requirements

Generate Reports

Testing External Devices

iPad/iPhone Testing

Cross-Browser Testing

Mocking & Fixtures

Mock PTY

Test Fixtures

CI/CD Testing

GitHub Actions

Debugging Tests

Debug Swift Tests

Debug TypeScript Tests

Best Practices

  1. Test naming: Use descriptive names like shouldCreateSessionWithCustomShell
  2. Isolation: Each test should be independent
  3. Cleanup: Always cleanup resources (sessions, files, connections)
  4. Assertions: Test both success and error cases
  5. Speed: Keep unit tests under 100ms each
  6. Flakiness: Retry flaky tests, investigate root cause

Common Issues

See Also