add-tests

Implement Jest unit tests for fe-tools utilities with deterministic inputs.

207|39|Updated Aug 29, 2017
One-click install
npx skills add https://github.com/MichealWayne/fe-tools --skill add-tests
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: add-tests
Source: https://github.com/MichealWayne/fe-tools/tree/main/utils/.cursor/skills/add-tests
Command: npx skills add https://github.com/MichealWayne/fe-tools --skill add-tests

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This skill streamlines the process of adding or updating Jest unit tests for fe-tools utilities, ensuring new changes are properly covered and regressions are prevented.

Core Features & Use Cases

  • Test scaffolding: Identify target package under packages/ and create or augment tests files that follow the project's naming conventions.
  • Deterministic tests: Use deterministic inputs and mock external dependencies to ensure stable test runs.
  • Regression protection: Extend test suites to cover new functions and edge cases triggered by changes.

Quick Start

Run focused tests for the affected package using the existing Jest setup.

Frequently Asked Questions about add-tests

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

FAQPage Schema
How do I automate Jest unit tests for JavaScript utility packages?

Automating Jest unit tests for JavaScript utilities involves identifying target packages, creating or augmenting __tests__ files following naming conventions, and writing deterministic test suites to cover newly added or modified functions.

What is the best way to add regression tests for refactored fe-tools functions?

Adding regression tests for refactored fe-tools functions requires extending existing Jest test suites to cover new edge cases and modifications, ensuring deterministic inputs and mocking external dependencies for stable execution.

How do I scaffold Jest test files for existing JavaScript utilities?

Scaffolding Jest test files involves identifying the target package under packages/, then creating or augmenting __tests__ files that align with the project's existing naming conventions and Jest configuration.

Does writing Jest tests for utilities require mocking external dependencies?

Writing Jest tests for utilities requires deterministic inputs and mocking external dependencies to prevent external I/O, ensuring stable and reliable test runs across newly added or modified functions.

Why should my JavaScript unit tests use deterministic inputs instead of external I/O?

JavaScript unit tests should use deterministic inputs instead of external I/O to ensure stable, repeatable test execution, preventing flaky tests and aligning with the project's Jest configuration for reliable regression protection.

Can I automatically cover edge cases when adding tests to modified JavaScript utilities?

Covering edge cases when adding tests to modified JavaScript utilities is achievable by extending the test suite to target specific refactored functions and new edge cases triggered by recent code changes.