unit-testing-test-generate
Generate comprehensive unit tests automatically
Writing unit tests manually is time-consuming and error-prone. This skill automates test generation across multiple languages and frameworks with edge case coverage and proper mocking.
下載技能 ZIP
在 Claude 中上傳
前往 設定 → 功能 → 技能 → 上傳技能
開啟並開始使用
測試它
正在使用「unit-testing-test-generate」。 Generate pytest tests for a calculator module with add, subtract, multiply functions
預期結果:
Test file with TestCalculator class containing parametrized tests for each operation, edge cases for zero and negative numbers, and type error handling
正在使用「unit-testing-test-generate」。 Create Jest tests for an async API client with mock fetch
預期結果:
Test suite with mocked fetch responses, tests for success and error states, proper async/await patterns, and timeout handling
安全審計
安全Static analysis detected 31 patterns but all are false positives. The skill is documentation-only containing code examples in markdown format. The subprocess.run pattern is legitimate test coverage functionality. Cryptographic warnings are Jest describe() functions. No executable code poses security risks.
品質評分
你能建構什麼
Rapid test suite creation for new projects
Quickly bootstrap comprehensive test coverage when starting a new codebase or adding tests to legacy code without existing tests.
Maintain test coverage during refactoring
Regenerate tests after significant code changes to ensure coverage remains high and edge cases are still validated.
Learn testing best practices by example
Study generated tests to understand proper mocking strategies, assertion patterns, and test organization for your framework.
試試這些提示
Generate pytest unit tests for the Python module at ./src/utils.py. Include tests for all public functions with happy path and error cases.
Create Jest tests for the functions in ./helpers/validation.js. Use proper mocking for external API calls and include edge cases for null and undefined inputs.
Generate React component tests for ./components/UserProfile.tsx using Testing Library. Test rendering, props handling, and user interactions like button clicks.
Analyze coverage report from ./coverage/coverage.json and generate targeted tests for all uncovered lines in the src/models/ directory. Focus on boundary conditions and exception handling.
最佳實務
- Always review generated tests to ensure assertions validate correct expected behavior
- Add domain-specific edge cases that automated analysis may not detect
- Run generated tests immediately to verify they pass before committing
避免
- Do not commit generated tests without reviewing and understanding each assertion
- Avoid generating tests for code that is rapidly changing - wait for stability
- Do not rely solely on generated tests for security-critical or financial calculations
常見問題
Which programming languages are supported?
Can this skill test private methods?
How do I handle database dependencies in generated tests?
Will the generated tests work with my existing CI pipeline?
How can I verify the quality of generated tests?
Can this skill update existing test files?
開發者詳情
作者
sickn33授權
MIT
儲存庫
https://github.com/sickn33/antigravity-awesome-skills/tree/main/skills/unit-testing-test-generate引用
main
檔案結構
📄 SKILL.md