write-tests

Generate unit and integration tests for code with JUnit, Jest, or PyTest.

3|1|Updated Feb 9, 2015
One-click install
npx skills add https://github.com/drafael/dotfiles --skill write-tests-drafael
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: write-tests
Source: https://github.com/drafael/dotfiles/tree/main/.agents/skills/write-tests
Command: npx skills add https://github.com/drafael/dotfiles --skill write-tests-drafael

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

This Skill automates the creation of unit and integration tests for your code, ensuring higher quality, better coverage, and more robust software.

Core Features & Use Cases

  • Automated Test Generation: Writes unit and integration tests based on code analysis.
  • Coverage Improvement: Identifies and adds test cases to cover uncovered lines and branches.
  • Use Case: When you've finished writing a new service function, use this Skill to automatically generate a suite of unit tests that verify its behavior under various conditions.

Quick Start

Use the write-tests skill to generate unit tests for the calculate_discount function in utils.py.

Frequently Asked Questions about write-tests

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

FAQPage Schema
How do I generate unit and integration tests to improve code coverage?

To generate unit and integration tests for higher code coverage, this Skill analyzes your code for critical logic and dependencies, creating test cases that target over 80% line and branch coverage using frameworks like JUnit, Jest, or PyTest.

Does automated test generation work with Jest and PyTest frameworks?

Yes, automated test generation works with Jest and PyTest. The Skill analyzes your codebase to implement tests using appropriate testing frameworks, including JUnit, Jest, or PyTest, while incorporating strategies for mocking and data setup.

What is the best way to create test cases for edge cases and dependencies?

The best way to create test cases for edge cases and dependencies is by analyzing the code to identify critical logic, which allows the Skill to automatically implement targeted tests with appropriate mocking and error handling strategies.

Can I use code analysis to automatically write tests for a service function?

Yes, you can use code analysis to automatically write tests for a service function. The Skill examines the function to uncover uncovered lines and branches, generating a suite of unit tests that verify behavior under various conditions.

How does mocking work when generating integration tests?

Mocking during integration test generation works by analyzing code dependencies and implementing strategies for data setup and error handling. This ensures the generated tests isolate critical logic and verify behavior accurately using frameworks like JUnit or Jest.