Test Runner Hook
Run tests related to changed files before committing
Category:hooks-configs
Type:hook
Difficulty:intermediate
testing
pre-commit
automation
intermediate
Description
Pre-commit hook that runs tests for changed files. Uses test framework's built-in related test detection to only run relevant tests, keeping commits fast while ensuring coverage.
Content
Resource Content
{
"hooks": {
"pre-commit": [
{
"name": "test-related",
"command": "npx jest --bail --findRelatedTests",
"match": "**/*.{js,jsx,ts,tsx}",
"description": "Run tests related to changed files"
}
]
}
}Rate This Resource
0
Help others discover great resources
Statistics
0
Stars
0
Copies
428
Days ago
336
Views
Claude Code Guides
A practical Claude Code path for finding, reproducing, and fixing bugs
Debugging Workflow
Use Claude Code effectively for debugging by combining context assembly, safe inspection tools, targeted reproduction, and focused fix loops.
How to use Claude Code for high-signal review instead of generic commentary
Code Review Workflow
A review workflow built around bug finding, risk analysis, and missing-test detection rather than vague style feedback.