Skip to content
Back to skills

Test Generator

ASecurity

Generates test cases for functions and components. Use when writing tests or creating test suites.

  • 69 stars
  • 0 votes
  • 0 copies
  • 8 views
  • Added May 27, 2026
developmenttypescriptgoapi

Works with

  • api

Security analysis

A100/100

Scanned May 27, 2026

npx -y skills add Tibsfox/gsd-skill-creator --skill test-generator --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Test Generator?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Test Generator
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/tibsfox-test-generator/badge)](https://www.skillsdirectory.com/skills/tibsfox-test-generator)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
name: test-generator
description: Generates test cases for functions and components. Use when writing tests or creating test suites.
version: 1.0.0
format: 2025-10-02
triggers:
  - writing tests or creating test suites
updated: 2026-04-25
status: ACTIVE
---

# Test Generation

## Structure (AAA Pattern)

```typescript
it('should [expected] when [condition]', () => {
  // Arrange — set up data
  // Act — perform operation
  // Assert — verify outcome
});
```

## Test Categories

| Category | Test For |
|----------|----------|
| Happy path | Valid input → expected output |
| Edge cases | Empty, null, boundary values |
| Error cases | Invalid input, failures |
| Side effects | State changes, calls made |
| Async | Resolve/reject paths |

## Naming

Pattern: `should [behavior] when [condition]`

## Organization

- Group with `describe` by function/method
- Reset state in `beforeEach`
- One concept per test

## Anti-Patterns

| Don't | Do |
|-------|------|
| Test implementation | Test behavior |
| Share mutable state | Reset in beforeEach |
| Many assertions per test | One concept per test |
| Test private methods | Test through public API |
| Snapshot overuse | Assert specific values |

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.