home / skills / alekspetrov / navigator / backend-test
This skill auto-generates backend tests for Python projects, including unit and integration tests with fixtures and mocks, ensuring coverage and reliability.
npx playbooks add skill alekspetrov/navigator --skill backend-testReview the files below or copy the command above to add this skill to your agents.
---
name: backend-test
description: Generate backend tests (unit, integration, mocks). Auto-invoke when user says "write test for", "add test", "test this", or "create test".
allowed-tools: Read, Write, Edit, Grep, Glob, Bash
version: 1.0.0
---
# Backend Test Generator
Generate comprehensive backend tests with Jest/Vitest including fixtures and mocks.
## When to Invoke
Auto-invoke when user mentions:
- "Write test for"
- "Add test"
- "Test this"
- "Create test"
- "Test [component/function]"
## What This Does
1. Generates test file with describe/it blocks
2. Creates test fixtures
3. Generates mocks for dependencies
4. Includes edge cases
5. Follows testing best practices
## Success Criteria
- [ ] Test file generated with proper structure
- [ ] Tests cover happy path and error cases
- [ ] Mocks isolate unit under test
- [ ] Fixtures provide test data
- [ ] Tests are runnable and pass
**Auto-invoke when writing backend tests** ๐งช
This skill generates backend tests for Python projects, including unit, integration, and mocked tests. It auto-invokes when you ask to write or add tests and produces runnable test files, fixtures, and dependency mocks. The output focuses on clear structure, edge cases, and maintainability.
On invocation it inspects the target code to identify functions, classes, and external dependencies, then scaffolds test files with describe/it-style sections adapted for pytest. It creates fixtures and mock objects to isolate the unit under test, adds happy-path and error-case tests, and includes instructions or commands to run the tests. The generator aims to produce tests that are runnable immediately and easy to extend.
Which test framework does this target?
It produces pytest-compatible tests by default but can adapt structure to other Python test frameworks on request.
Will generated tests run out of the box?
Yes โ tests include necessary fixtures and mock scaffolds and a brief command to run them, assuming standard project layout and dependencies.