test-conventions
Skill0 starsChanged 5 months agoMITView on GitHub
Testing conventions, selector best practices, DRY patterns, and coverage gap analysis. Use when writing, reviewing, or planning tests, or when the user asks what needs testing.
1 other project uses a version of this.
Adopted by
Most recently taken up by
- lichtblick-suite/lichtblicktheir own version, first seen Oct 8, 2026
Other versions1 project uses a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 1
- lichtblick-suite/lichtblick★ 1.2ksame name
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
In this repository18 other files it gives its agents.
- app-icon-gridSkill
- archive-manualSkill
- commitSkill
- component-consistencySkill
- component-locatorSkill
- debug-triageSkill
- gemini-iconSkill
- parity-auditorSkill
- prd-writingSkill
- refactor-and-safety-passSkill
- release-helperSkill
- smellSkill
- streamdeck-aerospace-rewireSkill
- streamdeck-workspace-buttonSkill
- svg-icon-renderSkill
- verification-gateSkill
- work-breakdownSkill
- yt-audioSkill
The file
We split this skill into the rules it gives an agent
6 rules. About 0 are common, 4 are distinctive, and 2 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈4
Distinctive · estimate
This author's own choices. Worth a look.
2
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 11
Avoid unnecessary snapshots unless the repo already relies on them.
- Very specific: line 12
Test file location: *.test.*, *.spec.*, or __tests__/ directories.
- Very specific: line 16
Check package.json devDependencies for jest, vitest, @testing-library/*, detox, etc.
- Distinctive: line 17
Look at existing test files for import patterns and conventions already in use.
- Distinctive: line 36
Use test factories/builders for common test data instead of duplicating object literals.
- Distinctive: line 43
When asked "what needs testing?" or to find test gaps:
≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Test Conventions
Deterministic Tests
- Mock network calls, timers, and randomness — tests must not depend on external state.
- Avoid unnecessary snapshots unless the repo already relies on them.
- Test file location:
*.test.*,*.spec.*, or__tests__/directories.
Stack Detection
Identify the test stack before writing anything:
- Check
package.jsondevDependencies for jest, vitest, @testing-library/*, detox, etc. - Look at existing test files for import patterns and conventions already in use.
- Match the existing stack — don't introduce a new test runner or library.
Selector Best Practices
Hierarchy of preference (most to least stable):
testIDprops — always prefer these for element selection- Accessibility role / label — stable and meaningful
- Semantic query (e.g.,
getByRole,getByLabelText) - Last resort: structure-based selectors
Never do:
- Query by display text or copy — breaks when copy changes
- Query by element count or string count — strings repeat across components
- Tie selectors to internal component structure, nesting depth, or class names
DRY Testing
- Extract shared setup into
beforeEachor helper functions. - Use test factories/builders for common test data instead of duplicating object literals.
- Share common assertions via custom matchers or helper functions.
- Parameterize similar tests with
test.each/it.eachinstead of copy-pasting test cases. - Extract common render + setup patterns into helper functions (e.g.,
renderWithProviders).
Coverage Gap Analysis
When asked "what needs testing?" or to find test gaps:
- Scan for untested modules — find source files with no corresponding test file.
- Prioritize by risk:
- Critical user paths (auth, payments, core flows) > recently changed code > complex branching logic
- Flag zero-coverage modules — components or utilities with no test file at all.
- Check edge cases — look for error handling, boundary conditions, and fallback logic that existing tests skip.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
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.

