agentleFS
harrissohail6harrissohail6/claude-code-config/skills/testing-strategies/SKILL.md

testing-strategies

Skill1 starsChanged 11 months agoMITView on GitHub

Comprehensive testing strategies and patterns. Auto-activates when writing or discussing tests.

Files
SKILL.md

Testing Strategies

Testing Pyramid

     /\        E2E (few) - Critical user flows
    /  \
   /----\      Integration (some) - API, DB
  /      \
 /--------\    Unit (many) - Functions, classes

Unit Test Patterns

AAA Pattern

test('should calculate discount', () => {
  // Arrange
  const price = 100;
  const discount = 0.2;

  // Act
  const result = calculateDiscount(price, discount);

  // Assert
  expect(result).toBe(80);
});

Test Doubles

// Mock - Verify interactions
const mockSave = jest.fn();

// Stub - Provide canned responses
jest.spyOn(api, 'fetch').mockResolvedValue({ data: [] });

// Fake - Working implementation
const fakeDb = new InMemoryDatabase();

What to Test

DO Test

  • Business logic
  • Edge cases (null, empty, max values)
  • Error handling
  • Public API contracts

DON'T Test

  • Implementation details
  • Third-party libraries
  • Simple getters/setters
  • Framework code

Coverage Goals

  • Unit: 80%+
  • Integration: Critical paths
  • E2E: Happy paths + main flows

Test Naming

should [expected behavior] when [condition]

Example: should return null when user not found

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

Reviews can't be read right now.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.