Testing Architecture
Description
This directory contains comprehensive test coverage for CUI services.
Installation
claude install-skill https://github.com/wbopan/cui README
Testing Architecture
This directory contains comprehensive test coverage for CUI services.
Testing Philosophy
- undefined
Test Structure
tests/
├── __mocks__
│ └── claude
├── integration
│ ├── conversation-status-integration.test.ts
│ ├── real-claude-integration.test.ts
│ └── streaming-integration.test.ts
├── setup.ts
├── unit
│ ├── cui-server.test.ts
│ ├── claude-history-reader.test.ts
│ ├── claude-process-long-running.test.ts
│ ├── claude-process-manager.test.ts
│ ├── cli
│ │ ├── get.test.ts
│ │ ├── list.test.ts
│ │ ├── serve.test.ts
│ │ ├── status-simple.test.ts
│ │ ├── status-working.test.ts
│ │ └── status.test.ts
│ ├── conversation-status-tracker.test.ts
│ ├── json-lines-parser.test.ts
│ └── stream-manager.test.ts
└── utils
└── test-helpers.ts
Mock Claude CLI
The project includes a mock Claude CLI (`tests/__mocks__/claude`) that:
- undefined
Testing Patterns
// Integration test pattern with mock Claude CLI
function getMockClaudeExecutablePath(): string {
return path.join(process.cwd(), 'tests', '__mocks__', 'claude');
}
// Server setup with random port to avoid conflicts
const serverPort = 9000 + Math.floor(Math.random() * 1000);
const server = new CUIServer({ port: serverPort });
// Override ProcessManager with mock path
const mockClaudePath = getMockClaudeExecutablePath();
const { ClaudeProcessManager } = await import('@/services/claude-process-manager');
(server as any).processManager = new ClaudeProcessManager(mockClaudePath);
Test Configuration
- undefined
Test Commands
# Run specific test files
npm test -- claude-process-manager.test.ts
npm test -- tests/unit/
# Run tests matching a pattern
npm test -- --testNamePattern="should start conversation"
# Run unit tests only
npm run unit-tests
# Run integration tests only
npm run integration-tests
# Run with coverage
npm run test:coverage
Development Practices
- undefined
Related Agents
Gitnexus Test Ci Verifier
GitNexus test and CI reviewer. Use to verify whether changed behavior is covered by targeted tests, whether CI actually runs those tests, and whether workflow changes weaken validation.
Testing & QA community Track Plan
| **Track ID:** {{TRACK_ID}} **Spec:** [spec.md](./spec.md) **Estimated Effort:** {{EFFORT_ESTIMATE}}... | - | [wshobson/agents](https://github.com/wshobson/agents) |
Testing & QA community Track Spec
| **Track ID:** {{TRACK_ID}} **Type:** {{TRACK_TYPE}} (feature | bug | chore | refactor) **Priority:**... | - | [wshobson/agents](https://github.com/wshobson/agents) |
Testing & QA community Workflow
| 1. **plan.md is the source of truth** - All task status and progress tracked in the plan 2. **Test-D... | - | [wshobson/agents](https://github.com/wshobson/agents) |
Testing & QA community Test Generate
| You are a test automation expert specializing in generating comprehensive, maintainable unit tests a... | - | [wshobson/agents](https://github.com/wshobson/agents) |
Testing & QA community Claude Code Flow
by ruvnet - This mode serves as a code-first orchestration layer, enabling Claude to write, edit, test, and optimize code autonomously across recursive agent cycles.
Testing & QA community