writing-tests

Author and debug cross-kernel tests for the brepjs CAD JavaScript library.

77|7|Updated Feb 1, 2026
One-click install
npx skills add https://github.com/andymai/brepjs --skill writing-tests-andymai
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: writing-tests
Source: https://github.com/andymai/brepjs/tree/main/.claude/skills/writing-tests
Command: npx skills add https://github.com/andymai/brepjs --skill writing-tests-andymai

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

The brepjs CAD library supports four distinct geometry kernels, each with unique behavioral quirks, strict code coverage thresholds, and complex CI/pre-commit quality gates. Writing tests that run reliably across all kernels, meet coverage requirements, and avoid common flakiness is time-consuming and error-prone without explicit, repository-specific guidance. This skill eliminates that friction by providing end-to-end instructions for the entire brepjs testing workflow.

Core Features & Use Cases

  • Cross-kernel test authoring: Guides you to write kernel-portable test skeletons, handle kernel-specific capability gaps and behavioral divergences via the official registry, and avoid common pitfalls like bare vitest runs that unintentionally fan out to all kernel projects.
  • Coverage and quality gate compliance: Explains how to meet strict coverage thresholds, troubleshoot coverage failures, and pass pre-commit and CI checks without unnecessary threshold lowering.
  • Regression and performance testing support: Covers writing regression tests, running stress and benchmark suites, and interpreting performance regression results to catch slowdowns early.
  • Use Case: When you add a new fillet operation to brepjs, this skill walks you through writing tests that run across all supported kernels, handling any kernel-specific divergence, verifying coverage meets the required floor, and confirming no performance regressions in related benchmarks.

Quick Start

Use the writing-tests skill to add a cross-kernel regression test for the new chamfer operation you just merged into brepjs, ensuring it passes the occt-wasm default gate and meets coverage requirements.

Frequently Asked Questions about writing-tests

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

FAQPage Schema
How do I write cross-kernel tests for brepjs that pass on all geometry kernels?

To write cross-kernel tests for brepjs, use kernel-portable test skeletons and handle kernel-specific behavioral divergences via the official registry. This ensures your tests run reliably across all supported geometry kernels without flakiness.

Why do my bare vitest runs unintentionally fan out to all brepjs kernel projects?

Bare vitest runs fan out to all kernel projects because they lack specific project targeting. You must use the correct configuration to isolate runs to a single kernel, such as the occt-wasm default gate, preventing unintended cross-kernel execution.

How do I meet strict code coverage thresholds for new brepjs operations?

To meet strict code coverage thresholds for new brepjs operations, follow the end-to-end testing workflow to verify your tests hit the required coverage floor. This helps you pass pre-commit and CI checks without unnecessarily lowering thresholds.

What is the best way to handle kernel-specific numeric tolerances in brepjs CAD tests?

Handling kernel-specific numeric tolerances in brepjs CAD tests requires using the official registry to manage behavioral divergences. This approach allows you to account for capability gaps and tolerance differences across distinct geometry kernels.

Can I detect performance regressions when adding a new chamfer or fillet operation to brepjs?

You can detect performance regressions when adding new chamfer or fillet operations by running stress and benchmark suites. Interpreting these regression results catches slowdowns early and confirms your new operation meets performance standards.

How do I troubleshoot failing cross-kernel regression tests in brepjs?

Troubleshooting failing cross-kernel regression tests in brepjs involves debugging through the multi-kernel test execution workflow. This process identifies whether failures stem from kernel-specific behavioral divergences or numeric tolerance mismatches.