agentsclimarketplace

Test generation

Skill EficodeDemoOrg/AccessHub_Claude/.claude/skills/test-generation

Testing style, scope, and examples for AccessHub (Vitest + Supertest backend, Vitest + Testing Library frontend). Use when adding or reviewing tests.From its SKILL.md

Install
npx -y skills add EficodeDemoOrg/AccessHub_Claude --skill test-generation

Assembled from the repository path, not quoted from the project. Check it against their README if it does not work.

2 things to look at

  • no licenseNo license file was found in the repository. Code published without one is not open source by default, so using it at work is a question for whoever answers licensing questions where you are.
  • 0 stars0 stars. Stars are a popularity signal and not a quality one, but at this level it is likely that nobody has read this closely except its author, and you would be relying on your own review.

SKILL.md

1.2 KB, as published. Nobody here has run it

Test Generation

How to write tests that fit AccessHub.

Scope

  • Service logic — business rules and authorization decisions.
  • API endpoints — especially authorization-sensitive ones; assert status and error.code on failures.
  • Domain edge cases — not-found, conflict, already-processed, revoked key, expired access.

Backend style (Vitest + Supertest)

  • Build the app with createApp() and drive it with Supertest.
  • Reseed fixtures with resetDb() from src/tests/helpers.ts in beforeEach.
  • Set the acting user with the x-user-id header.
const res = await request(app)
  .post('/api/access-requests/req-pending/approve')
  .set('x-user-id', 'u-omar');
expect(res.status).toBe(200);

Frontend style (Vitest + Testing Library)

  • Render components/App with a mocked fetch.
  • Assert on visible text and on controls being present/absent by role/permission.

Rules

  • Add tests before the fix when reproducing a bug.
  • Readable, behavior-focused names. No over-mocking. Never weaken a test to pass.

Keep looking

Skills are one crate of 607,721. Ordering is by how many stacks a row turns up in, so the top of any crate is what has actually been picked rather than what has the most stars.