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
npx -y skills add EficodeDemoOrg/AccessHub_Claude --skill test-generationAssembled 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.codeon 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()fromsrc/tests/helpers.tsinbeforeEach. - Set the acting user with the
x-user-idheader.
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/
Appwith a mockedfetch. - 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.