jest

Generate Jest test suites for ESLint rules in TypeScript projects.

2|1|Updated May 16, 2023
One-click install
npx skills add https://github.com/BluMintInc/eslint-custom-rules --skill jest-blumintinc
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: jest
Source: https://github.com/BluMintInc/eslint-custom-rules/tree/main/.claude/skills/jest
Command: npx skills add https://github.com/BluMintInc/eslint-custom-rules --skill jest-blumintinc

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes scripts (resource) and references (resource) components.

What problem does it solve?

This Skill ensures that all custom ESLint rules are thoroughly tested, preventing regressions and guaranteeing correct behavior.

Core Features & Use Cases

  • Automated Test Generation: Creates comprehensive Jest test suites for ESLint rules.
  • High Code Coverage: Aims for 90-100% coverage for rule logic and auto-fixers.
  • Use Case: When a new ESLint rule is developed, use this Skill to automatically generate its corresponding Jest test suite, ensuring it catches all intended violations and passes valid code.

Quick Start

Use the jest skill to implement a Jest test suite for the ESLint rule located at src/rules/my-rule.ts.

Frequently Asked Questions about jest

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

FAQPage Schema
How do I generate Jest tests for custom ESLint rules in TypeScript?

To generate Jest tests for custom ESLint rules, this Skill automates the creation of comprehensive test suites using RuleTester utilities. It targets your TypeScript rules to ensure high code coverage and prevent regressions in both rule logic and auto-fixers.

What is the best way to achieve high code coverage for ESLint rule logic and auto-fixers?

Achieving high code coverage for ESLint rule logic and auto-fixers requires comprehensive test suites. This Skill generates Jest tests automatically, aiming for 90-100% coverage to validate that rules catch all intended violations and pass valid code.

Do I need ts-jest to test custom ESLint rules in a TypeScript project?

Yes, you need ts-jest to test custom ESLint rules in a TypeScript project. This Skill requires Jest with ts-jest for execution and assertions, alongside RuleTester utilities, to properly run the generated test suites.

How does automated test generation prevent regressions in ESLint rules?

Automated test generation prevents regressions in ESLint rules by creating comprehensive Jest test suites that validate rule behavior. It ensures the rules consistently catch intended violations and correctly process valid code across updates.

Can I use this to test ESLint rules that include auto-fixers?

Yes, you can use this to test ESLint rules with auto-fixers. The generated Jest test suites aim for 90-100% coverage specifically targeting both the core rule logic and the auto-fixer implementations to ensure correct behavior.