Agent skill
testing
Testing guidance for this repo (unit, component, integration, and E2E). Includes troubleshooting.
Stars
163
Forks
31
Install this agent skill to your Project
npx add-skill https://github.com/majiayu000/claude-skill-registry/tree/main/skills/development/testing-mpaicoding-byte-labtracksimple
SKILL.md
Testing (Repo-Specific)
Use this skill when running or troubleshooting tests in this repo. Tests must be run by the agent (automatic); do not ask the user to run them.
Playwright (E2E)
- Dev server EPERM
- Start
npm run devin the host terminal and run tests with:E2E_BASE_URL=http://127.0.0.1:3000
- Start
- Supabase target
- Tests run against the external Supabase project only; keep
.env.localpointing to the remote project.
- Tests run against the external Supabase project only; keep
- System Chrome permission errors
- Use bundled Chromium (default) by leaving
PW_USE_CHROMEunset. - Only set
PW_USE_CHROME=trueif you explicitly want system Chrome.
- Use bundled Chromium (default) by leaving
- Missing bundled browsers
- Run once:
npx playwright install
- Run once:
- E2E entry command pattern
E2E_BASE_URL=http://127.0.0.1:3000 npm run test:e2e -- <spec>
- Review/commit setup
- Set
SUPABASE_SERVICE_ROLE_KEYin.envso admin seeding is not skipped.- Wait for sign-in redirect before navigating to protected review URLs.
UI Verification (Mandatory)
- Any UI change requires verification using the Chrome DevTools MCP.
- Save verification screenshots in
docs/screenshotsonly (remove any other screenshot folders), using<scenario>_<version>.png(e.g.login_001.png).
Unit / Component
- Unit:
npm run test(node --test). - Component:
npm run test:unit(vitest + jsdom).
Integration
- Use Supabase MCP for DB setup, verification or anyting and don't call via cli or use local supabase installation.
Lint / Typecheck
- Lint:
npm run lint. - Typecheck:
tsc --noEmit(or project script if present).
General
- If any error is found while testing, or any bug is reported, create a test for that if that doesn't exist
- Supabase MCP is there if you want to interact with supabase outside the unit, e2e, integration tests.
Didn't find tool you were looking for?