Introduce new outputs

This commit is contained in:
Phil Jay
2024-08-31 14:38:32 +10:00
parent 836a0f07bb
commit 5af72f0ae1
5 changed files with 41 additions and 7 deletions

View File

@@ -414,8 +414,8 @@ function init_repo {
@test "increments the patch version by default if no conventional commits found and enabled (conventional commits) (with tag_prefix)" {
init_repo
export tag_prefix="@org/product"
export current_version="@org/product@1.2.3"
export tag_prefix="@org/product@"
export current_version="1.2.3"
export scheme="conventional_commits"
echo "some new change" > feat.txt
@@ -426,7 +426,7 @@ function init_repo {
print_run_info
[ "$status" -eq 0 ] &&
[[ "$output" = *"VERSION=@org/product@1.2.4"* ]]
[[ "$output" = *"V_VERSION=@org/product@v1.2.4"* ]]
[[ "$output" = *"VERSION=1.2.4"* ]]
[[ "$output" = *"V_VERSION=v1.2.4"* ]]
[[ "$output" = *"No conventional commit found"* ]]
}

View File

@@ -156,6 +156,20 @@ function init_repo {
[[ "$output" = *"CURRENT_VERSION=0.0.0"* ]]
}
@test "returns 0.0.0 if no prefix version detected even if there's a non-prefix release version" {
init_repo
export tag_prefix="code/"
git tag 0.1.0
run version-lookup.sh
print_run_info
[ "$status" -eq 0 ] &&
[[ "$output" = *"CURRENT_VERSION=0.0.0"* ]]
}
@test "returns a calver if no normal version detected and calver scheme specified" {
init_repo