[CRITICAL] Replace explicit 'any' types with proper mocks in tests #261

Closed
opened 2026-02-02 23:16:00 +00:00 by jason.woltje · 1 comment
Owner

Priority: CRITICAL - Quality Rails violation

CLAUDE.md Violation: Quality Rails blocks @typescript-eslint/no-explicit-any: error

Problem:
Test files use explicit any types (6+ instances), violating TypeScript strict mode and quality standards.

Files Affected:

  • apps/orchestrator/src/api/agents/agents.controller.spec.ts (Lines 9, 10, 16, 24, 165, 179)
  • apps/orchestrator/src/coordinator/coordinator-client.service.spec.ts (Lines 12, 24)

Acceptance Criteria:

  • All any types replaced with proper mock types
  • pnpm --filter @mosaic/orchestrator lint shows 0 no-explicit-any errors
  • All tests still pass

Example Fix:

// Instead of:
let queueService: any;
let spawnerService: any;

// Use:
let queueService: { addTask: ReturnType<typeof vi.fn> };
let spawnerService: { spawnAgent: ReturnType<typeof vi.fn> };

Code Review Confidence: 92%
Found by: pr-review-toolkit:code-reviewer

**Priority:** CRITICAL - Quality Rails violation **CLAUDE.md Violation:** Quality Rails blocks `@typescript-eslint/no-explicit-any: error` **Problem:** Test files use explicit `any` types (6+ instances), violating TypeScript strict mode and quality standards. **Files Affected:** - `apps/orchestrator/src/api/agents/agents.controller.spec.ts` (Lines 9, 10, 16, 24, 165, 179) - `apps/orchestrator/src/coordinator/coordinator-client.service.spec.ts` (Lines 12, 24) **Acceptance Criteria:** - [ ] All `any` types replaced with proper mock types - [ ] `pnpm --filter @mosaic/orchestrator lint` shows 0 `no-explicit-any` errors - [ ] All tests still pass **Example Fix:** ```typescript // Instead of: let queueService: any; let spawnerService: any; // Use: let queueService: { addTask: ReturnType<typeof vi.fn> }; let spawnerService: { spawnAgent: ReturnType<typeof vi.fn> }; ``` **Code Review Confidence:** 92% **Found by:** pr-review-toolkit:code-reviewer
jason.woltje added this to the M6-AgentOrchestration (0.0.6) milestone 2026-02-02 23:16:00 +00:00
jason.woltje added the testingorchestrator labels 2026-02-02 23:16:00 +00:00
Author
Owner

Fixed: Replaced all explicit 'any' types with proper type assertions. All tests now have proper type safety.

✅ Fixed: Replaced all explicit 'any' types with proper type assertions. All tests now have proper type safety.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: mosaic/stack#261