skills/role-expert-testing_obsessive/SKILL.md
Pragmatic testing with Vitest: risk-based strategy, Svelte component testing, test-after development.
npx skillsauth add jasonwarrenuk/goblin-mode testing-obsessiveInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
Comprehensive testing guidance for JavaScript/TypeScript applications, with emphasis on Vitest, Svelte component testing, and pragmatic test-after development. Addresses testing as a professional skill for portfolio evidence and code quality.
Use this skill when:
Not for 100% coverage - Test for:
/\
/ \ E2E Tests
/ \ (Few, slow, expensive)
/------\
/ \ Integration Tests
/ \ (Some, medium speed)
/------------\
/ \ Unit Tests
---------------- (Many, fast, cheap)
Distribution target:
Test-after development workflow:
This approach:
Prioritize testing based on risk assessment
Impact - What breaks if this fails?
Complexity - How likely to have bugs?
Change Frequency - How often modified?
HIGH PRIORITY (Must test):
✓ Payment/financial logic
✓ Authentication/authorization
✓ Data validation and persistence
✓ Critical user journeys
✓ Complex algorithms
✓ API integrations
✓ Security-sensitive code
✓ Accessibility requirements (keyboard nav, screen reader, contrast)
MEDIUM PRIORITY (Should test):
✓ Business logic with multiple branches
✓ Utility functions used across codebase
✓ Form validation
✓ Data transformations
✓ Error handling paths
✓ Frequently changed features
LOW PRIORITY (Optional):
- Simple getters/setters
- UI styling/layout
- Configuration files
- Straightforward CRUD operations
- One-time scripts
// HIGH RISK - Must test
// Impact: Critical (payments)
// Complexity: High (currency conversion, rounding)
// Change frequency: Medium
function calculateOrderTotal(items, discounts, taxRate) {
// Complex calculation logic
// Write comprehensive tests
}
// MEDIUM RISK - Should test
// Impact: Medium (UX issue if broken)
// Complexity: Medium (validation rules)
// Change frequency: Low
function validateEmail(email) {
// Standard validation
// Write basic tests
}
// LOW RISK - Optional
// Impact: Low (cosmetic)
// Complexity: Low (simple assignment)
// Change frequency: Low
function getUserDisplayName(user) {
return user.name || user.email;
// Can skip testing, or add simple test
}
Focus on making it work:
Don't worry about tests yet - understand the problem first.
Test the feature manually:
Document interesting cases - these become test scenarios.
Ask yourself:
Use the priority matrix to decide testing level.
Based on risk assessment:
High priority - Comprehensive tests:
describe('calculateOrderTotal', () => {
it('should calculate total with single item');
it('should apply percentage discount');
it('should apply fixed discount');
it('should calculate tax correctly');
it('should handle multiple currencies');
it('should round to 2 decimal places');
it('should throw on negative prices');
it('should handle empty cart');
});
Medium priority - Essential tests:
describe('validateEmail', () => {
it('should accept valid email');
it('should reject invalid format');
it('should reject missing domain');
});
Low priority - Skip or minimal:
// Maybe one smoke test if you're feeling thorough
it('should return user name when available', () => {
expect(getUserDisplayName({ name: 'Alice' })).toBe('Alice');
});
Now that tests exist:
Tests catch regressions while you improve code.
When bugs are found, use this workflow:
Write failing test that reproduces the issue:
it('should handle empty cart without crashing', () => {
// This currently fails
const result = calculateOrderTotal([], [], 0.2);
expect(result).toBe(0);
});
Implement the fix:
function calculateOrderTotal(items, discounts, taxRate) {
if (items.length === 0) return 0; // Fix
// Rest of logic...
}
Run test suite, confirm:
This test now prevents the bug from returning.
Benefits:
Mechanical how-to and reference material, loaded only when needed:
Tests are effective when they:
tools
{{ 𝚫𝚫𝚫 }} Rebuild roadmap-system.zip, the distributable snapshot of the roadmap tooling (scripts, HTML template, conventions reference, and every roadmap-touching skill, including this one).
tools
--- name: "Suggest: Task" description: "{{ 𝚫𝚫𝚫 }} Suggest the next logical task — grounded in the roadmap's pre-vetted ready-set when one exists, codebase analysis otherwise" when_to_use: "When you don't know what to work on next and want a grounded recommendation rather than picking arbitrarily." model: haiku effort: low disable-model-invocation: true allowed-tools: ["Read", "Glob", "Grep", "Bash(python3:*)", "Bash(npm:*)", "Bash(bun:*)", "Bash(pnpm:*)", "Bash(deno:*)"] argument-hint: [named
development
{{ 𝛀𝛀𝛀 }} Convert an old simple-style roadmap (single Markdown, four statuses, <a name> anchors, roadmaps.json pointer registry) into the rich phase-array format (roadmaps.json source of truth + PHASE task list + prose overview).
data-ai
{{ ƔƔƔ }} Create a pull request to main — wordy or shiny (with screenshots), ready-for-review or draft