diff --git a/lib/modules/versioning/hex/index.spec.ts b/lib/modules/versioning/hex/index.spec.ts index 6ec94685bf8db531ce515b973e57f8087adb12e3..11a70b073c003322bc3af3b002a41b865256f23c 100644 --- a/lib/modules/versioning/hex/index.spec.ts +++ b/lib/modules/versioning/hex/index.spec.ts @@ -63,24 +63,26 @@ describe('modules/versioning/hex/index', () => { ); it.each` - currentValue | rangeStrategy | currentVersion | newVersion | expected - ${'== 1.2.3'} | ${'pin'} | ${'1.2.3'} | ${'2.0.7'} | ${'== 2.0.7'} - ${'== 3.6.1'} | ${'bump'} | ${'3.6.1'} | ${'3.6.2'} | ${'== 3.6.2'} - ${'== 3.6.1'} | ${'replace'} | ${'3.6.1'} | ${'3.6.2'} | ${'== 3.6.2'} - ${'~> 1.2'} | ${'replace'} | ${'1.2.3'} | ${'2.0.7'} | ${'~> 2.0'} - ${'~> 1.2'} | ${'pin'} | ${'1.2.3'} | ${'2.0.7'} | ${'== 2.0.7'} - ${'~> 1.2'} | ${'bump'} | ${'1.2.3'} | ${'2.0.7'} | ${'~> 2.0'} - ${'~> 1.2'} | ${'bump'} | ${'1.2.3'} | ${'1.3.1'} | ${'~> 1.3'} - ${'~> 1.2.0'} | ${'replace'} | ${'1.2.3'} | ${'2.0.7'} | ${'~> 2.0.0'} - ${'~> 1.2.0'} | ${'pin'} | ${'1.2.3'} | ${'2.0.7'} | ${'== 2.0.7'} - ${'~> 1.2.0'} | ${'bump'} | ${'1.2.3'} | ${'2.0.7'} | ${'~> 2.0.7'} - ${'>= 1.0.0 and <= 2.0.0'} | ${'widen'} | ${'1.2.3'} | ${'2.0.7'} | ${'>= 1.0.0 and <= 2.0.7'} - ${'>= 1.0.0 and <= 2.0.0'} | ${'replace'} | ${'1.2.3'} | ${'2.0.7'} | ${'<= 2.0.7'} - ${'>= 1.0.0 and <= 2.0.0'} | ${'pin'} | ${'1.2.3'} | ${'2.0.7'} | ${'== 2.0.7'} - ${'>= 1.0.0 or <= 2.0.0'} | ${'widen'} | ${'1.2.3'} | ${'2.0.7'} | ${'>= 1.0.0 or <= 2.0.0'} - ${'>= 1.0.0 or <= 2.0.0'} | ${'replace'} | ${'1.2.3'} | ${'2.0.7'} | ${'<= 2.0.7'} - ${'>= 1.0.0 or <= 2.0.0'} | ${'pin'} | ${'1.2.3'} | ${'2.0.7'} | ${'== 2.0.7'} - ${'~> 0.4'} | ${'replace'} | ${'0.4.2'} | ${'0.6.0'} | ${'~> 0.6'} + currentValue | rangeStrategy | currentVersion | newVersion | expected + ${'== 1.2.3'} | ${'pin'} | ${'1.2.3'} | ${'2.0.7'} | ${'== 2.0.7'} + ${'== 3.6.1'} | ${'bump'} | ${'3.6.1'} | ${'3.6.2'} | ${'== 3.6.2'} + ${'== 3.6.1'} | ${'replace'} | ${'3.6.1'} | ${'3.6.2'} | ${'== 3.6.2'} + ${'~> 1.2'} | ${'replace'} | ${'1.2.3'} | ${'2.0.7'} | ${'~> 2.0'} + ${'~> 1.2'} | ${'pin'} | ${'1.2.3'} | ${'2.0.7'} | ${'== 2.0.7'} + ${'~> 1.2'} | ${'bump'} | ${'1.2.3'} | ${'2.0.7'} | ${'~> 2.0'} + ${'~> 1.2'} | ${'bump'} | ${'1.2.3'} | ${'1.3.1'} | ${'~> 1.3'} + ${'~> 1.1'} | ${'update-lockfile'} | ${'1.2.0'} | ${'1.3.0'} | ${'~> 1.1'} + ${'~> 1.1'} | ${'update-lockfile'} | ${'1.2.0'} | ${'2.0.0'} | ${'~> 2.0'} + ${'~> 1.2.0'} | ${'replace'} | ${'1.2.3'} | ${'2.0.7'} | ${'~> 2.0.0'} + ${'~> 1.2.0'} | ${'pin'} | ${'1.2.3'} | ${'2.0.7'} | ${'== 2.0.7'} + ${'~> 1.2.0'} | ${'bump'} | ${'1.2.3'} | ${'2.0.7'} | ${'~> 2.0.7'} + ${'>= 1.0.0 and <= 2.0.0'} | ${'widen'} | ${'1.2.3'} | ${'2.0.7'} | ${'>= 1.0.0 and <= 2.0.7'} + ${'>= 1.0.0 and <= 2.0.0'} | ${'replace'} | ${'1.2.3'} | ${'2.0.7'} | ${'<= 2.0.7'} + ${'>= 1.0.0 and <= 2.0.0'} | ${'pin'} | ${'1.2.3'} | ${'2.0.7'} | ${'== 2.0.7'} + ${'>= 1.0.0 or <= 2.0.0'} | ${'widen'} | ${'1.2.3'} | ${'2.0.7'} | ${'>= 1.0.0 or <= 2.0.0'} + ${'>= 1.0.0 or <= 2.0.0'} | ${'replace'} | ${'1.2.3'} | ${'2.0.7'} | ${'<= 2.0.7'} + ${'>= 1.0.0 or <= 2.0.0'} | ${'pin'} | ${'1.2.3'} | ${'2.0.7'} | ${'== 2.0.7'} + ${'~> 0.4'} | ${'replace'} | ${'0.4.2'} | ${'0.6.0'} | ${'~> 0.6'} `( 'getNewValue("$currentValue", "$rangeStrategy", "$currentVersion", "$newVersion") === "$expected"', ({ currentValue, rangeStrategy, currentVersion, newVersion, expected }) => { diff --git a/lib/modules/versioning/hex/index.ts b/lib/modules/versioning/hex/index.ts index b84ff6189fb344afc7d4ad96c85debc36ca5ce75..f82d9f9b1b034b5157dba284f34508cd66561583 100644 --- a/lib/modules/versioning/hex/index.ts +++ b/lib/modules/versioning/hex/index.ts @@ -12,6 +12,7 @@ export const supportedRangeStrategies: RangeStrategy[] = [ 'widen', 'pin', 'replace', + 'update-lockfile', ]; function hex2npm(input: string): string {