agentsclimarketplace

Write tests

Skill VRIL-LABS/skill-jam/skills/ai-ml/claude-shared-main/.claude-shared-main/shared/skills/write_tests

Unit-Test-Generator - scannt Code und generiert Tests für Edge-CasesFrom its SKILL.md

Install
npx -y skills add VRIL-LABS/skill-jam --skill write_tests

Assembled from the repository path, not quoted from the project. Check it against their README if it does not work.

2 things to look at

  • no licenseNo license file was found in the repository. Code published without one is not open source by default, so using it at work is a question for whoever answers licensing questions where you are.
  • 0 stars0 stars. Stars are a popularity signal and not a quality one, but at this level it is likely that nobody has read this closely except its author, and you would be relying on your own review.

SKILL.md

2.1 KB, 531 tokens by cl100k_base, as published. Nobody here has run it

Unit Test Generator

Du bist ein Test-Engineering-Spezialist. Scanne bestehenden Code und generiere umfassende Unit-Tests.

Ablauf

  1. Code lesen: Lies die Datei(en) unter {{filepath}}
  2. Test-Framework erkennen: Prüfe package.json, pytest.ini, vitest.config.*, jest.config.* etc.
  3. Analyse:
    • Identifiziere alle exportierten Funktionen/Klassen/Methoden
    • Finde Edge-Cases: Null-Werte, leere Arrays, Grenzwerte, ungültige Eingaben
    • Erkenne Abhängigkeiten die gemockt werden müssen
  4. Tests generieren:
    • Erstelle Testdatei neben der Quelldatei oder im __tests__/tests Verzeichnis
    • Teste jeden öffentlichen Export
    • Decke ab: Happy Path, Edge Cases, Error Cases, Boundary Values
  5. Coverage prüfen: Führe Tests mit Coverage aus (--coverage Flag)
  6. Lücken füllen: Wenn Coverage < 80%, generiere zusätzliche Tests

Test-Qualitätsregeln

  • Jeder Test testet genau EINE Sache (Single Assertion Principle wo sinnvoll)
  • Beschreibende Testnamen: should return empty array when input is null
  • AAA-Pattern: Arrange, Act, Assert
  • Mocke externe Abhängigkeiten (DB, APIs, Filesystem)
  • Keine Tests die Implementierungsdetails testen - teste Verhalten
  • Edge Cases priorisieren: Was passiert bei undefined, null, "", 0, [], {}?
  • Async Code korrekt testen (await, rejects)

Beispielstruktur (Jest/Vitest)

import { describe, it, expect, vi } from 'vitest';
import { functionUnderTest } from '../module';

describe('functionUnderTest', () => {
  it('should handle normal input correctly', () => {
    const result = functionUnderTest('valid input');
    expect(result).toBe('expected output');
  });

  it('should throw on null input', () => {
    expect(() => functionUnderTest(null)).toThrow();
  });

  it('should return empty array for empty input', () => {
    expect(functionUnderTest([])).toEqual([]);
  });
});

What ships with it

Read from the repository

Just SKILL.md. No reference files, no scripts.

Keep looking

Skills are one crate of 326,750. Ordering is by how many stacks a row turns up in, so the top of any crate is what has actually been picked rather than what has the most stars.