.cursor/skills/tests/SKILL.md
Good vs bad tests (integration-style, public API, behavior not implementation). Use when writing or reviewing tests, or paired with TDD and mocking skills.
npx skillsauth add jorgsouza/QAFeedback testsInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
Integration-style: Test through real interfaces, not mocks of internal parts.
// GOOD: Tests observable behavior
test("user can checkout with valid cart", async () => {
const cart = createCart();
cart.add(product);
const result = await checkout(cart, paymentMethod);
expect(result.status).toBe("confirmed");
});
Characteristics:
Implementation-detail tests: Coupled to internal structure.
// BAD: Tests implementation details
test("checkout calls paymentService.process", async () => {
const mockPayment = jest.mock(paymentService);
await checkout(cart, payment);
expect(mockPayment.process).toHaveBeenCalledWith(cart.total);
});
Red flags:
// BAD: Bypasses interface to verify
test("createUser saves to database", async () => {
await createUser({ name: "Alice" });
const row = await db.query("SELECT * FROM users WHERE name = ?", ["Alice"]);
expect(row).toBeDefined();
});
// GOOD: Verifies through interface
test("createUser makes user retrievable", async () => {
const user = await createUser({ name: "Alice" });
const retrieved = await getUser(user.id);
expect(retrieved.name).toBe("Alice");
});
development
Test-driven development with red-green-refactor loop. Use when user wants to build features or fix bugs using TDD, mentions "red-green-refactor", wants integration tests, or asks for test-first development.
development
Refactor candidates after TDD (duplication, long methods, shallow modules, etc.). Use during refactor phase of red-green-refactor or when reviewing code quality.
tools
Turn a PRD into a multi-phase implementation plan using tracer-bullet vertical slices, saved under ./prd/PRD-NNN-feature-slug/plan.md (see prd/INDEX.md). Use when user wants to break down a PRD, create an implementation plan, plan phases from a PRD, or mentions "tracer bullets".
development
When and how to mock (system boundaries only, DI, SDK-style APIs). Use when writing tests, reviewing mocks, or the user asks what to mock.