From 356714bed021480db130c05179d8d93e875da67f Mon Sep 17 00:00:00 2001 From: typicode Date: Sun, 8 May 2022 23:04:16 +0200 Subject: [PATCH] test: command not found message --- test/7_command_not_found.sh | 13 +++++++++++++ test/all.sh | 1 + 2 files changed, 14 insertions(+) create mode 100644 test/7_command_not_found.sh diff --git a/test/7_command_not_found.sh b/test/7_command_not_found.sh new file mode 100644 index 000000000..56dd3e3c4 --- /dev/null +++ b/test/7_command_not_found.sh @@ -0,0 +1,13 @@ +. "$(dirname -- "$0")/functions.sh" +setup +install + +npx --no-install husky install + +# Test core.hooksPath +expect_hooksPath_to_be ".husky" + +# Test pre-commit with 127 exit code +git add package.json +npx --no-install husky add .husky/pre-commit "exit 127" +expect 1 "git commit -m foo" diff --git a/test/all.sh b/test/all.sh index 682a853f5..3ca4be8a5 100644 --- a/test/all.sh +++ b/test/all.sh @@ -7,3 +7,4 @@ sh test/3_from-sub-dir.sh sh test/4_not-git-dir.sh sh test/5_set-add.sh sh test/6_git_command_not_found.sh +sh test/7_command_not_found.sh