/quicktest
Description
finds the test file for your current file, runs just that test, and reports results. if no test file exists, offers to create one
Installation
This entry records only its repository, not the path inside it, so there is no
exact command to give. Open the source below and copy the folder into
~/.claude/skills/, or the file into ~/.claude/agents/.
Repository README
This is the README for anipotts/claude-code-tips, shared by 6 entries
in this directory. It describes the repository, not this entry specifically.
name: quicktest description: run tests for current file allowed-tools:
- Bash
- Read
- Glob
- Grep
- Write
/quicktest
finds the test file for your current file, runs just that test, and reports results. if no test file exists, offers to create one
what it does
- figures out which file you're working on from recent context
- finds the corresponding test file using common naming conventions
- runs only that test file (not the whole suite)
- reports pass/fail with relevant output
- if no test file exists, offers to scaffold one using the test-writer pattern
how to use it
test whatever file you were just editing:
/quicktest
test a specific file:
/quicktest lib/auth.ts
create the test file if it doesn't exist:
/quicktest lib/auth.ts --create
the prompt
When the user runs /quicktest, do the following:
## Step 1: Identify the target file
- If the user specified a file, use that
- If not, look at the recent conversation for the last file that was edited or discussed
- If you still can't tell, ask
## Step 2: Find the test file
Search for matching test files using these conventions (try all, use the first match):
For `src/lib/auth.ts`:
- `src/lib/auth.test.ts`
- `src/lib/auth.spec.ts`
- `src/lib/__tests__/auth.test.ts`
- `src/lib/__tests__/auth.spec.ts`
- `tests/lib/auth.test.ts`
- `test/lib/auth.test.ts`
- `tests/lib/auth_test.ts`
For Python `src/auth.py`:
- `src/test_auth.py`
- `tests/test_auth.py`
- `src/auth_test.py`
For Rust `src/auth.rs`:
- Check for `#[cfg(test)]` module inside the file itself
- `tests/auth.rs`
Use Glob to search. Adapt the patterns to match the project's existing test structure.
## Step 3: Run the test
Detect the test runner from the project:
- **package.json** with jest/vitest: `npx vitest run ` or `npx jest `
- **pytest**: `python -m pytest -v`
- **cargo**: `cargo test --lib -- --nocapture` or `cargo test --test `
- **go**: `go test -v -run ./`
Run with verbose output so individual test results are visible. Set a 60-second timeout.
## Step 4: Report results
If tests pass:
- Show count: "4/4 tests passed"
- Show runtime
If tests fail:
- Show which tests failed with the error message
- Show the relevant assertion or error, not the full stack trace
- Read the failing test to understand what it expected
- Briefly suggest what might be wrong
## Step 5: No test file? Create one
If no test file was found:
1. Tell the user: "no test file found for "
2. If --create flag or user confirms, scaffold a test file:
- Read the source file to understand exports
- Create test file following the project's existing test conventions
- Write basic test structure with describe blocks for each exported function
- Add 2-3 edge case tests per function (empty input, error path, boundary)
- Don't write the actual assertions — use TODO comments so the user fills in expected values
Related Skills
Spec Kit
💫 Toolkit to help you get started with Spec-Driven Development
Testing Webapp Testing
Test local web applications using Playwright for UI verification and debugging
Testing #29
, [#52](https://github.com/affaan-m/everything-claude-code/issues/52), [#103](https://github.com/affaan-m/ever
Testing Fix Issue
by metabase - Addresses GitHub issues by taking issue number as parameter, analyzing context, implementing sol
Testing Pypict Test Design
Design comprehensive test cases using PICT (Pairwise Independent Combinatorial Testing) for optimized test sui
Testing gstack
| 15,000+ | Garry Tan's exact Claude Code setup: 6 opinionated tools that serve as CEO, Eng Manager, Release M
Testing