exec git init
exec git config user.email "you@example.com"
exec git config user.name "Your Name"
exec git add -A
exec lefthook install
! exec git commit -m 'test'
stderr '\s*fails: no such command\s*'

-- lefthook.yml --
output:
  - failure
pre-commit:
  jobs:
    - name: fails
      run: oops-no-such-command
      fail_text: no such command
