Skip to content

Commit

Permalink
Add test
Browse files Browse the repository at this point in the history
  • Loading branch information
narze committed Jun 19, 2024
1 parent 0c6d222 commit 5f13d9c
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions tests/test_version-increment.bats
Original file line number Diff line number Diff line change
Expand Up @@ -233,6 +233,23 @@ function init_repo {
[[ "$output" = *"VERSION=1.2.4-pre.${short_ref}"* ]]
}

@test "does not append prerelease information if on a branch but disabled_pre_release" {
init_repo

export current_version=1.2.3
export GITHUB_REF="refs/heads/super-awesome-feature"
export short_ref="$(git rev-parse --short HEAD | sed 's/0*//')"
export disable_pre_release="true"

run version-increment.sh

print_run_info
[ "$status" -eq 0 ] &&
[[ "$output" != *"PRE_RELEASE_LABEL=pre."* ]] &&
[[ "$output" != *"VERSION=1.2.4-pre."* ]] &&
[[ "$output" = *"VERSION=1.2.4"* ]]
}

@test "does not append prerelease information if on a specified release_branch" {
init_repo

Expand Down

0 comments on commit 5f13d9c

Please sign in to comment.