js-testing

Streamline JavaScript/TypeScript testing workflows across Jest, Vitest, and Node's test runner.

Updated Mar 31, 2026
One-click install
npx skills add https://github.com/dotBeeps/hoard --skill js-testing
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: js-testing
Source: https://github.com/dotBeeps/hoard/tree/main/morsels/skills/js-testing
Command: npx skills add https://github.com/dotBeeps/hoard --skill js-testing

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

JavaScript/TypeScript testing can be time-consuming and error-prone without a consistent framework and patterns. This skill provides structured guidance on test structure, mocking, assertions, fixtures, snapshots, and debugging.

Core Features & Use Cases

  • Test structure patterns for Jest and Vitest, including describe/it blocks and co-located tests
  • Mocking, spying, and assertion techniques with examples
  • Snapshot and coverage workflows, debugging strategies, and Node's built-in test runner support
  • Use cases include writing unit tests, debugging failures, setting up test frameworks, and maintaining test suites

Quick Start

Install and configure Jest or Vitest in your project and begin writing tests following the patterns above.

Frequently Asked Questions about js-testing

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

FAQPage Schema
How do I structure JavaScript and TypeScript tests using Jest or Vitest?

Structure JavaScript and TypeScript tests using describe/it blocks and co-located test files. This approach streamlines test organization for both Jest and Vitest, ensuring clear execution paths for unit and integration testing scenarios.

What is the best way to mock modules and spy on functions in Vitest?

Mocking and spying in Vitest use structured patterns for intercepting module calls and tracking function execution. These techniques integrate with standard assertion workflows to isolate units and verify integration behavior during test execution.

Does this testing workflow support Node's built-in test runner?

Yes, this testing workflow supports Node's built-in test runner alongside Jest and Vitest. It provides clear conventions for test organization and execution across multiple frameworks within a Node.js environment, requiring no additional dependencies.

How do I debug failing Jest or Vitest tests in my project?

Debug failing Jest or Vitest tests using structured debugging strategies provided by the workflow. These strategies help identify assertion failures, snapshot mismatches, and mock execution errors to resolve test suite issues effectively.

Can I use this for snapshot testing and coverage reports in TypeScript?

Yes, you can use this for snapshot testing and coverage reports in TypeScript. The workflow applies specific patterns for capturing snapshots and measuring coverage across unit and integration tests to maintain suite reliability.

Why do I need a Node.js environment for JavaScript test workflows?

A Node.js environment is required to execute JavaScript and TypeScript test workflows because Jest and Vitest rely on the Node runtime to process test files, resolve modules, and generate coverage reports.