testing

Run Mocha, Chai, Sinon, and C8 tests across TypeScript Nx monorepo packages.

9|2|Updated Apr 13, 2024
One-click install
npx skills add https://github.com/JacobLey/leyman --skill testing-jacobley
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: testing
Source: https://github.com/JacobLey/leyman/tree/main/.claude/skills/testing
Command: npx skills add https://github.com/JacobLey/leyman --skill testing-jacobley

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Writing and maintaining reliable tests is essential to prevent regressions and ensure code quality across a TypeScript monorepo. This Skill integrates Mocha, Chai, Sinon, and C8 to provide consistent unit, integration, and coverage reporting.

Core Features & Use Cases

  • Mocha as test runner with Chai for assertions and Sinon for spies/mocks
  • 100% coverage enforcement via C8 and integration with nx test targets
  • Standardized testing structure across packages (unit/integration) and clear failure reports
  • Useful for CI pipelines to ensure stable releases and high-quality code

Quick Start

Run the full test suite for all packages using nx run-many -t test.

Frequently Asked Questions about testing

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

FAQPage Schema
How do I set up Mocha and Chai testing in a TypeScript Nx monorepo?

To set up Mocha and Chai testing in a TypeScript Nx monorepo, use this Skill to standardize your test organization across packages, integrating Sinon for mocks and C8 for coverage to ensure robust code quality.

How do I enforce 100% code coverage in an Nx workspace?

You can enforce 100% code coverage in an Nx workspace by configuring C8 within your test targets, halting CI pipelines when coverage drops and generating clear, CI-ready failure reports for missing paths.

Does this testing approach support both unit and integration tests?

Yes, this testing approach supports both unit and integration tests by providing a standardized structure across packages within an Nx workspace, utilizing Mocha to run the comprehensive suite and Sinon for spies.

What is the best way to run a full test suite across all Nx packages?

The best way to run a full test suite across all Nx packages is using the command 'nx run-many -t test', which executes the Mocha tests and C8 coverage enforcement across the entire monorepo.

Why do I need Sinon and C8 for TypeScript monorepo testing?

You need Sinon and C8 for TypeScript monorepo testing to isolate dependencies with spies and mocks while strictly enforcing 100% code coverage, preventing regressions and ensuring consistent releases.

How do I get CI-ready test reports for a TypeScript monorepo?

To get CI-ready test reports for a TypeScript monorepo, integrate Mocha and C8 into your nx test targets, providing structured guidance for execution and reliable failure reports for stable releases.