Skip to content

Commit

Permalink
test: npm-post improve test coverage/cases
Browse files Browse the repository at this point in the history
  • Loading branch information
dalisoft committed Apr 27, 2024
1 parent f05b344 commit 54f571e
Showing 1 changed file with 13 additions and 11 deletions.
24 changes: 13 additions & 11 deletions tests/plugins/npm-post.test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -50,19 +50,8 @@ setup_suite() {
exit 1
fi
}
git() {
# shellcheck disable=SC2317
if [ "$1" == "push" ]; then
return 0
elif [ "$1" == "remote" ]; then
printf "%s" "https://github.com/dalisoft/release-me"
else
command git "$@"
fi
}

export -f _npm
export -f git

fake npm _npm
}
Expand Down Expand Up @@ -127,6 +116,19 @@ test_plugin_npm_post_0_6_custom_gpg_npm_message() {
assert_matches "0.0.5" "$(cat package.json)"
}
test_plugin_npm_post_0_7_custom_gpg_npm_message_preinstalled() {
git() {
# shellcheck disable=SC2317
if [ "$1" == "push" ]; then
return 0
elif [ "$1" == "remote" ]; then
printf "%s" "https://github.com/dalisoft/release-me"
else
command git "$@"
fi
}

export -f git

unset GPG_KEY_ID
unset GPG_PASSPHRASE
unset GPG_KEY
Expand Down

0 comments on commit 54f571e

Please sign in to comment.