libharness

Design and run mock-based test harnesses for copilot-ld services.

1|1|Updated Aug 7, 2025
One-click install
npx skills add https://github.com/copilot-ld/copilot-ld --skill libharness
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: libharness
Source: https://github.com/copilot-ld/copilot-ld/tree/main/packages/libharness
Command: npx skills add https://github.com/copilot-ld/copilot-ld --skill libharness

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

libharness provides a comprehensive test harness and mock infrastructure for copilot-ld tests, enabling isolated unit testing without depending on real services.

Core Features & Use Cases

  • Fixtures and mocks for common services (config, storage, logger, gRPC, and clients)
  • Fixture-driven test data and assertion helpers
  • Generated type integrations with libtype to ensure mocks match production interfaces

Quick Start

Install the package and import mocks from @copilot-ld/libharness to begin writing tests with the provided factories and fixtures.

Frequently Asked Questions about libharness

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I mock gRPC clients for isolated unit testing in Node.js?

Mock gRPC clients for isolated unit testing by importing client mocks and factories from the test harness, allowing you to simulate service interactions without real dependencies. The harness provides fixtures to drive deterministic test data and assertions.

What is a test harness and when do I need fixtures for unit tests?

A test harness is an infrastructure layer that provides mocks, factories, and fixtures to isolate code during unit tests. You need it when testing service interactions like storage or logging without depending on real external systems.

Can I simulate configuration and storage service interactions in a test environment?

Yes, you can simulate configuration and storage service interactions using the provided test harness mocks. It applies mock objects across config, storage, and logging to enable deterministic unit tests in varied environments.

What's the best way to ensure mocks match production interfaces in a test harness?

The best way to ensure mocks match production interfaces is by integrating generated types from libtype into your test harness. This alignment guarantees that mock objects and factories accurately reflect the production service contracts.

Do I need generated types to use mock factories for gRPC testing?

Yes, generated types are required to align mocks with production interfaces. The test harness relies on these libtype-generated types so that gRPC mock factories and fixtures correctly simulate real service interactions during testing.