ask-unit-test-generation
<critical_constraints> ❌ NO tests without edge cases ❌ NO generic assertions (assertTrue) → use specific (assertEqual, toEqual) ❌ NO test dependencies → each test must be independent ✅ MUST follow Arrange-Act-Assert (AAA) pattern ✅ MUST mock external dependencies (APIs, DB, filesystem) ✅ MUST use descriptive test names (what + expected outcome) </critical_constraints>
<test_categories>
- Normal cases: typical usage
- Edge cases: empty, zero, max, boundary
- Error cases: invalid input, exceptions
- Type edges: None/null, wrong types
- Performance: large inputs (if applicable) </test_categories>
def test_edge_empty(self):
assert func([]) == []
def test_error_raises(self):
with pytest.raises(ValueError):
func(invalid)
## JavaScript (Jest)
```javascript
describe('functionName', () => {
it('should return X when Y', () => {
expect(func(input)).toBe(expected);
});
it('should throw on invalid', () => {
expect(() => func(null)).toThrow(TypeError);
});
});
More from navanithans/agent-skill-kit
ask-explaining-code
Explain code via analogies, ASCII diagrams, step-by-step walkthroughs.
17ask-owasp-security-review
Static security analysis auditing for OWASP Top 10 risks.
15ask-system-architect-prime
Principal Architect for repo audits, complexity analysis, and refactoring recommendations.
15ask-nextjs-architect
Next.js 14+ scaffolding. App Router, Server Components, Server Actions, SEO.
15ask-commit-assistance
Code review, staging, and Conventional Commit message generation. MUST NOT COMMIT.
15ask-python-refactor
Python refactoring for readability, maintainability, and performance.
14