Skip to content
Snippets Groups Projects
Unverified Commit 65606c5c authored by Carsten Zeumer's avatar Carsten Zeumer Committed by GitHub
Browse files

fix(manager/terraform): Terraform module version is missing `v` Prefix (#18392)

parent 9e45418a
No related branches found
No related tags found
No related merge requests found
...@@ -79,4 +79,20 @@ describe('modules/versioning/hashicorp/index', () => { ...@@ -79,4 +79,20 @@ describe('modules/versioning/hashicorp/index', () => {
expect(res).toEqual(expected); expect(res).toEqual(expected);
} }
); );
test.each`
currentValue | rangeStrategy | currentVersion | newVersion | expected
${'v0.14'} | ${'replace'} | ${'v0.14.2'} | ${'v0.15.0'} | ${'v0.15'}
`(
'getNewValue("$currentValue", "$rangeStrategy", "$currentVersion", "$newVersion") === "$expected"',
({ currentValue, rangeStrategy, currentVersion, newVersion, expected }) => {
const res = semver.getNewValue({
currentValue,
rangeStrategy,
currentVersion,
newVersion,
});
expect(res).toEqual(expected);
}
);
}); });
...@@ -81,12 +81,20 @@ function getNewValue({ ...@@ -81,12 +81,20 @@ function getNewValue({
); );
} }
} }
return npm.getNewValue({ let npmNewVersion = npm.getNewValue({
currentValue, currentValue,
rangeStrategy, rangeStrategy,
currentVersion, currentVersion,
newVersion, newVersion,
}); });
if (
npmNewVersion &&
currentValue.startsWith('v') &&
!npmNewVersion.startsWith('v')
) {
npmNewVersion = `v${npmNewVersion}`;
}
return npmNewVersion;
} }
export const api: VersioningApi = { export const api: VersioningApi = {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment