jest

Run JavaScript and TypeScript unit tests with coverage and snapshot reports.

Updated Apr 10, 2026
One-click install
npx skills add https://github.com/theslashdojo/dojo --skill jest-theslashdojo
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: jest
Source: https://github.com/theslashdojo/dojo/tree/main/nodes/testing/jest
Command: npx skills add https://github.com/theslashdojo/dojo --skill jest-theslashdojo

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes scripts (resource) components.

What problem does it solve?

Provides a consistent, discoverable workflow to write, run, and maintain JavaScript and TypeScript unit tests so teams can catch regressions early and validate behavior before shipping.

Core Features & Use Cases

  • Run and filter test suites, produce coverage reports, and update snapshots for component and unit tests.
  • Built-in patterns for mocking, spies, timer control, parameterized tests, and TypeScript support via ts-jest or SWC transforms.
  • Use Case: Validate backend service logic with isolated mocks, run coverage in CI, and maintain snapshot tests for UI components.

Quick Start

Run the project's Jest test suite with the provided script and include coverage or a name/path filter as needed.

Frequently Asked Questions about jest

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

FAQPage Schema
How do I run TypeScript unit tests with Jest and generate a coverage report?

Run TypeScript unit tests with Jest by executing the provided helper script in a bash-compatible shell, passing coverage flags to generate reports. This requires Jest available locally or via npx/pnpx/yarn, and optional ts-jest or @swc/jest for transforms.

What's the best way to mock modules and update snapshots for JavaScript unit tests?

The best way to mock modules and update snapshots for JavaScript unit tests is using built-in Jest patterns for mocking, spies, and timer control. Run the helper script with snapshot update flags to maintain component snapshot tests.

Does this workflow support Node.js backend service logic validation with isolated mocks?

Yes, this workflow supports Node.js backend service logic validation with isolated mocks. It applies to projects with jest in devDependencies or a package.json test script, enabling isolated mock testing for backend service logic.

Can I use SWC transforms instead of ts-jest for TypeScript testing in CI scenarios?

Yes, you can use SWC transforms instead of ts-jest for TypeScript testing in CI scenarios. The environment supports optional ts-jest or @swc/jest transforms to handle TypeScript files during Jest test execution.

Why are my Jest unit tests not working in my frontend project?

Jest unit tests may not be working if the project environment lacks a bash-compatible shell or local Jest availability via npx/pnpx/yarn. Ensure test files match common patterns and jest.config files are properly configured.

Do I need a specific package.json test script to run parameterized tests and filter test suites?

You need a project environment with Jest available locally or via npx/pnpx/yarn to run parameterized tests and filter test suites. A package.json test script for unit testing ensures discoverability, along with jest.config files.