Spaces:
Running
Running
feat(agent): add Claude Code-style agent, skills, slash-commands, hooks, todos, sandboxed workspace, and full-stack scaffolding
81aa0b5 verified A newer version of the Gradio SDK is available: 6.19.0
metadata
name: test
description: Generate tests for the current code or a specific file
argument-hint: File path or test framework
Test Generation
Target: $ARGUMENTS
Generate tests for the specified file or the current changes.
Process
If a file path is given,
read_fileit. Otherwise usebashto getgit diff HEADand identify changed files.Identify the test framework in use:
- Python: pytest (preferred), unittest
- JavaScript: vitest, jest, mocha
- Check
package.jsonorrequirements.txtfor hints
Read existing tests in the
tests/or__tests__/directory to match style.Generate tests that cover:
- Happy path (typical usage)
- Edge cases (empty input, boundary values)
- Error cases (invalid input, network failures)
- Integration points (if applicable)
Write the test file to the appropriate location using
write_file.Run the tests with
bashto verify they pass.
Rules
- One test file per source file (e.g.
src/auth.py→tests/test_auth.py) - Use descriptive test names:
test_user_can_login_with_valid_credentials - Arrange-Act-Assert pattern
- Don't test the framework — test your code's behavior
- Mock external dependencies (network, filesystem, time) when flaky