emanuprods/dotfiles/test-generation

Claude Code and agent skill by emanuprods/dotfiles

Trust tier 3
  • community
Source check pending

Checking that the SKILL.md file is still in the repository.

Generates unit, integration, and e2e tests following best practices. Use when adding test coverage, creating test files, or improving existing tests.

Install

npx vskill@latest install emanuprods/dotfiles/test-generation

SKILL.md

The same SKILL.md was published earlier as emanuprods/dotfiles/test-generation.

Test Generation Skill

Testing Pyramid

E2E Tests (few)
/ \
Integration Tests
/ \
Unit Tests (many)

Unit Test Patterns

AAA Pattern (Arrange-Act-Assert)
typescript
describe("UserService", () => {
it("should return user by id", async () => {
// Arrange
const mockRepo = createMockRepository();
mockRepo.findById.mockResolvedValue(user);
const service = new UserService(mockRepo);
// Act
const result = await service.getUser(1);
// Assert
expect(result).toEqual(user);
expect(mockRepo.findById).toHaveBeenCalledWith(1);
});
});
Test Naming
typescript
// Format: should_<expected behavior>_when_<condition>
it("should_return_user_when_id_exists", () => {});
it("should_throw_not_found_when_id_missing", () => {});
Edge Cases to Cover
  • Null/undefined inputs
  • Empty collections
  • Boundary values (0, -1, max int)
  • Invalid formats
  • Concurrency (race conditions)
  • Timeouts/retries

Integration Test Patterns

Database Tests
typescript
describe("UserRepository", () => {
let db: TestDatabase;
beforeAll(async () => {
db = await TestDatabase.create();
await db.migrate();
});
afterAll(async () => {
await db.destroy();
});
beforeEach(async () => {
await db.truncate("users");
});
it("should persist and retrieve user", async () => {
const repo = new UserRepository(db);
await repo.save(user);
const found = await repo.findById(user.id);
expect(found).toEqual(user);
});
});
API Tests
typescript
describe("POST /api/users", () => {
it("should create user and return 201", async () => {
const response = await request(app)
.post("/api/users")
.send({ name: "John", email: "john@example.com" })
.expect(201);
expect(response.body).toMatchObject({
id: expect.any(String),
name: "John",
email: "john@example.com"
});
});
});

E2E Test Patterns (Playwright)

typescript
test("user can login and view dashboard", async ({ page }) => {
await page.goto("/login");
await page.fill('[name="email"]', "user@example.com");
await page.fill('[name="password"]', "password123");
await page.click('button[type="submit"]');
await expect(page).toHaveURL("/dashboard");
await expect(page.locator("h1")).toContainText("Dashboard");
});

Test Utilities

Factory Functions
typescript
function createTestUser(overrides: Partial<User> = {}): User {
return {
id: "test-id",
name: "Test User",
email: "test@example.com",
createdAt: new Date(),
...overrides
};
}
Mock Helpers
typescript
function createMockRepository<T>() {
return {
findById: vi.fn<T, [string]>(),
findAll: vi.fn<T[], []>(),
save: vi.fn<Promise<void>, [T]>(),
delete: vi.fn<Promise<void>, [string]>()
};
}

Coverage Targets

LayerTargetNotes
Unit80%+Business logic, pure functions
Integration60%+DB, external APIs, message queues
E2E20%+Critical user journeys only

When to Use

  • Adding tests for new features
  • Improving coverage on existing code
  • Creating test utilities/factories
  • Setting up test infrastructure
  • Converting manual tests to automated

Security

  • Security scanPassed, 90 of 100Pattern checks on the skill's files.
  • Model reviewPassed

Quality evaluation

  • Task evaluationNot runNo evaluation yet. Run one in Skill Studio.

Source

Popularity

7-day trend score
0

Not refreshed yet.

Works with

Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.

  • Claude Code
  • Cursor
  • GitHub Copilot
  • Windsurf
  • Codex
  • Gemini CLI
  • Cline
  • Amp
  • Roo Code
  • Goose
  • Continue
  • Kilo Code
  • Junie
  • Trae
  • OpenHands
  • Qwen Code
  • AI Agent
  • Tabnine Chat
  • Sourcegraph Cody
  • Amazon Q
  • Firebase Genkit
  • Sweep
  • Devin
  • Phind
  • Mentat
  • Claude Desktop
  • Aider
  • GPT Pilot
  • Plandex
  • bolt.new
  • v0
  • Replit Agent
  • Anse
  • TypingMind
  • BetterChatGPT
  • LibreChat
  • Warp AI
  • Pieces
  • Fig AI
Embed badge
vskill VERIFIED badge
[![vskill VERIFIED](https://verified-skill.com/api/v1/skills/emanuprods/dotfiles/test-generation/badge)](https://verified-skill.com/skills/emanuprods/dotfiles/test-generation)

Something wrong with this skill or its page? Tell us.