一键导入
test-local
// Test prove_it from source against an example project or temp directory. Use when you want to verify hook behavior end-to-end without a Homebrew release.
// Test prove_it from source against an example project or temp directory. Use when you want to verify hook behavior end-to-end without a Homebrew release.
Release a new version of prove_it. Use when asked to cut a release, publish a new version, or "ship" it.
Create a temporary real project and prove a prove_it feature works (or doesn't) end-to-end. Builds a disposable git repo, writes a focused config, runs real dispatches through the installed or local prove_it, and produces a human-readable session transcript. Use when you need to prove a feature, reproduce a bug, or validate a fix against a real project — not just unit tests.
Inspect prove_it session logs—review history, reviewer verdicts, and session state. Use when asked about session logs, reviewer results, or "what did the last hook say".
| name | test-local |
| description | Test prove_it from source against an example project or temp directory. Use when you want to verify hook behavior end-to-end without a Homebrew release. |
Run prove_it from the repo source (not the Homebrew install) to test hook behavior.
Identify the test target. If the user didn't specify, use example/basic/.
Set up the PATH shim so prove_it resolves to the repo's cli.js:
export PATH="$(git rev-parse --show-toplevel)/test/bin:$PATH"
which prove_it # should show test/bin/prove_it
Run the requested test. Common scenarios:
Test a specific hook event:
cd example/basic
echo '{"hook_event_name":"Stop","session_id":"test","cwd":"."}' | prove_it hook claude:Stop
Test SessionStart:
echo '{"hook_event_name":"SessionStart","source":"startup","session_id":"test","cwd":"."}' | prove_it hook claude:SessionStart
Test PreToolUse (edit protection):
echo '{"hook_event_name":"PreToolUse","tool_name":"Edit","tool_input":{"file_path":"src/greet.js"},"session_id":"test","cwd":"."}' | prove_it hook claude:PreToolUse
Test PreToolUse (commit gate):
echo '{"hook_event_name":"PreToolUse","tool_name":"Bash","tool_input":{"command":"git commit -m test"},"session_id":"test","cwd":"."}' | prove_it hook claude:PreToolUse
Test init in a temp directory:
tmpdir=$(mktemp -d)
cd "$tmpdir" && git init
prove_it init --no-default-checks
cat .claude/prove_it/config.json
prove_it deinit
rm -rf "$tmpdir"
Test doctor:
cd example/basic
prove_it doctor
Report the output and whether the behavior matches expectations.
test/bin/prove_it just does exec node ../../cli.js "$@"$(prove_it prefix)/libexec/* commands in configs will also resolve through the shim