writing-tests

Generate unit and integration tests for JavaScript/TypeScript codebases.

1|Updated Jun 23, 2022
One-click install
npx skills add https://github.com/PavkaBrika/debtbookapp --skill writing-tests-pavkabrika
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: writing-tests
Source: https://github.com/PavkaBrika/debtbookapp/tree/main/.cursor/skills/writing-tests
Command: npx skills add https://github.com/PavkaBrika/debtbookapp --skill writing-tests-pavkabrika

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Analyze existing codebases and automatically generate comprehensive unit and integration tests, detecting the current test framework, identifying untested code paths, and producing tests with mocks, edge cases, and assertions. Use when the user asks to add tests, improve coverage, or test a specific module.

Core Features & Use Cases

  • Detects existing test setups and configurations, and identifies the test framework in use.
  • Scaffolds missing tests and configures a test runner if none exists, aligning with project conventions.
  • Analyzes target files to uncover public APIs, code paths, and edge cases, then generates tests with mocks and assertions for modules, components, and utilities.

Quick Start

Ask me to add tests for a specific file or module, and I will scaffold unit and integration tests with appropriate mocks and coverage.

Frequently Asked Questions about writing-tests

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

FAQPage Schema
How do I generate unit tests for an existing JavaScript codebase?

To generate unit tests for JavaScript, you can automate the analysis of target files to detect public APIs and edge cases, producing tests with mocks and assertions that align with your project conventions.

Can I automatically add integration tests to TypeScript modules?

Yes, you can automatically scaffold integration tests for TypeScript modules by analyzing code paths and generating assertions with mocks to maximize test coverage.

How do I scaffold tests if my project has no test runner configured?

Scaffolding tests without a runner involves scanning the project to configure a test runner from scratch, aligning with existing conventions while generating unit and integration tests with mocks.

What is the best way to increase test coverage for untested code paths?

The best way to increase test coverage is to analyze existing files to uncover untested code paths and edge cases, then automatically generate unit and integration tests with appropriate mocks.

Does automated test generation preserve existing testing patterns?

Yes, automated test generation detects existing test setups and configurations to ensure newly scaffolded unit and integration tests preserve your current testing patterns and project conventions.