Install any skill in seconds. Free to start, no credit card required.
Get Started Free →Teaches the Red-Green-Refactor test-driven development workflow with Arrange-Act-Assert test structure and Jest/Vitest patterns.
78% 87%+9 ptsof test cases passed
Passed 20 of 23 test cases with the skill, and 18 of 23 without it.
3 of 3 safety checks passed
Not used yet
Never write production code without a failing test first. Each cycle should take 2-10 minutes.
Use the Arrange-Act-Assert pattern consistently:
Arrange: Set up test data and dependencies
Act: Execute the behavior under test
Assert: Verify the expected outcome
Name tests as test_<unit>_<scenario>_<expected_result> or it("should <behavior> when <condition>").
describe("OrderService", () => {
it("should apply discount when order exceeds threshold", () => {
const order = createOrder({ items: [{ price: 150, qty: 1 }] });
const result = applyDiscount(order, { threshold: 100, percent: 10 });
expect(result.total).toBe(135);
});
it("should throw when applying discount to empty order", () => {
const order = createOrder({ items: [] });
expect(() => applyDiscount(order, defaultDiscount)).toThrow(EmptyOrderError);
});
});
Use vi.fn() / jest.fn() for mocks. Prefer dependency injection over module mocking. Use beforeEach for shared setup, never share mutable state between tests.
Skills that do similar work, with their benchmark result.
Next to this one in the catalogue, plus more from the same author.