← ClaudeAtlas

test-generationlisted

TDD patterns and language-specific test examples for TypeScript/Jest, Python/pytest, and Go. Use when writing tests, increasing coverage, or implementing test-driven development.
paruff/uFawkesAI · ★ 2 · Testing & QA · score 74
Install: claude install-skill paruff/uFawkesAI
# Skill: Test Generation > **Load trigger:** `"load test-generation skill"` > **DORA:** Cap 5 (Small Batches / Shift Left on Quality) > **Token cost:** Low ## TDD Pattern — Language Agnostic ### Commit Sequence (required order) ``` 1. test: add failing tests for [feature] ← CI fails here intentionally 2. feat: implement [feature] to pass tests 3. refactor: clean up [feature] if needed ``` ## TypeScript/Jest Pattern ```typescript // tests/services/auth.test.ts import { signIn } from "../src/services/auth"; import { mockFirebaseAuth } from "./mocks/firebase"; describe("signIn", () => { it("returns user object on valid credentials", async () => { mockFirebaseAuth.mockResolvedValueOnce({ uid: "user-123", email: "test@test.com", }); const result = await signIn("test@test.com", "valid-password"); expect(result.uid).toBe("user-123"); }); it("throws AuthError when credentials are invalid", async () => { mockFirebaseAuth.mockRejectedValueOnce(new Error("auth/wrong-password")); await expect(signIn("test@test.com", "wrong")).rejects.toThrow( "auth/wrong-password", ); }); it("throws AuthError when email is malformed", async () => { await expect(signIn("not-an-email", "password")).rejects.toThrow(); }); }); ``` ## Python/pytest Pattern ```python # tests/test_auth.py import pytest from unittest.mock import patch, MagicMock from src.services.auth import sign_in, AuthError def test_sign_in_returns_user_on_valid_cr