improve-tests

Analyze JavaScript and TypeScript test suites for coverage gaps and nondeterministic behavior.

Updated Dec 31, 2022
One-click install
npx skills add https://github.com/lucasols/tsdf --skill improve-tests-lucasols
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: improve-tests
Source: https://github.com/lucasols/tsdf/tree/main/.agents/skills/improve-tests
Command: npx skills add https://github.com/lucasols/tsdf --skill improve-tests-lucasols

SYSTEM DOCUMENTATION & REQUIREMENTS

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

What problem does it solve?

It streamlines the process of improving test suites by automating analysis and suggestions to increase coverage, clarity, and robustness.

Core Features & Use Cases

  • Test Quality Assessment: Analyzes existing tests for coverage gaps, readability, and determinism.
  • Test Improvement Suggestions: Recommends changes to enhance realistic scenarios, assertions, and comments.
  • Use Case: A developer runs this Skill on their Vitest suite to identify flaky tests, unclear setup, or missing edge case coverage, then applies the recommendations to produce a stronger test suite.

Quick Start

Use the improve-tests skill to analyze the current test directory, then receive actionable suggestions for enhancement.

Frequently Asked Questions about improve-tests

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

FAQPage Schema
How do I identify coverage gaps and flaky behavior in my JavaScript test suite?

To identify coverage gaps and flaky behavior in a JavaScript test suite, you can analyze existing tests for nondeterministic timing, missing edge cases, and unclear assertions. This process highlights weaknesses in unit and integration testing workflows to ensure tests accurately reflect production scenarios and provide meaningful regression feedback.

What is the best way to improve test readability and reliability in Vitest?

The best way to improve test readability and reliability in Vitest is to analyze conventional assertion usage, mock setups, and timing controls. Refining these elements clarifies test intentions and ensures consistent, deterministic execution across your unit and integration environments.

Can I use this to analyze both unit and integration tests in TypeScript projects?

Yes, you can analyze both unit and integration tests in TypeScript projects. The analysis evaluates conventional assertion usage, mocks, and timing controls to ensure tests accurately reflect production scenarios and provide meaningful feedback on regressions across your testing workflows.

Why does my test suite have nondeterministic behavior and how do I fix it?

Nondeterministic behavior in a test suite often stems from improper timing controls or mock setups. You can fix it by analyzing tests for conventional assertion usage and applying recommendations that enforce deterministic execution and accurate production scenario reflection.