@@ -185,6 +185,49 @@ describe('amend prompting', () => {
185185 } )
186186} )
187187
188+ describe ( 'no-verify prompting' , ( ) => {
189+ test ( 'prompts for git commit --no-verify' , ( ) => {
190+ const { output, exitCode } = runHook ( createInput ( 'git commit --no-verify -m "Skip hooks"' ) )
191+
192+ expect ( exitCode ) . toBe ( 0 )
193+ expect ( output ?. hookSpecificOutput ?. permissionDecision ) . toBe ( 'ask' )
194+ expect ( output ?. hookSpecificOutput ?. permissionDecisionReason ) . toContain ( 'bypass' )
195+ } )
196+
197+ test ( 'prompts for git commit with --no-verify and other flags' , ( ) => {
198+ const { output, exitCode } = runHook ( createInput ( 'git commit -a --no-verify -m "Message"' ) )
199+
200+ expect ( exitCode ) . toBe ( 0 )
201+ expect ( output ?. hookSpecificOutput ?. permissionDecision ) . toBe ( 'ask' )
202+ } )
203+
204+ test ( 'prompts for git commit --no-verify without message' , ( ) => {
205+ const { output, exitCode } = runHook ( createInput ( 'git commit --no-verify' ) )
206+
207+ expect ( exitCode ) . toBe ( 0 )
208+ expect ( output ?. hookSpecificOutput ?. permissionDecision ) . toBe ( 'ask' )
209+ } )
210+
211+ test ( 'prompts for git commit --no-verify with heredoc' , ( ) => {
212+ const command = `git commit --no-verify -m "$(cat <<'EOF'
213+ Test commit message
214+ EOF
215+ )"`
216+
217+ const { output, exitCode } = runHook ( createInput ( command ) )
218+
219+ expect ( exitCode ) . toBe ( 0 )
220+ expect ( output ?. hookSpecificOutput ?. permissionDecision ) . toBe ( 'ask' )
221+ } )
222+
223+ test ( 'allows regular git commit without --no-verify' , ( ) => {
224+ const { output, exitCode } = runHook ( createInput ( 'git commit -m "Regular commit"' ) )
225+
226+ expect ( exitCode ) . toBe ( 0 )
227+ expect ( output ) . toBeNull ( )
228+ } )
229+ } )
230+
188231describe ( 'attribution stripping' , ( ) => {
189232 test ( 'strips "Generated with Claude Code" line' , ( ) => {
190233 const command = `git commit -m "Test commit
0 commit comments