diff --git a/scripts/__tests__/version-utils-test.js b/scripts/__tests__/version-utils-test.js index da5b67402a4810..ad6d958ebff313 100644 --- a/scripts/__tests__/version-utils-test.js +++ b/scripts/__tests__/version-utils-test.js @@ -141,15 +141,6 @@ describe('version-utils', () => { expect(prerelease).toBe('rc.4'); }); - it('should reject pre-release version with patch != 0', () => { - function testInvalidVersion() { - parseVersion('0.66.3-rc.4', 'release'); - } - expect(testInvalidVersion).toThrowErrorMatchingInlineSnapshot( - `"Version 0.66.3-rc.4 is not valid for Release"`, - ); - }); - it('should reject pre-release version from tag with random prerelease pattern', () => { function testInvalidVersion() { parseVersion('v0.66.0-something_invalid', 'release'); @@ -233,15 +224,6 @@ describe('version-utils', () => { expect(prerelease).toBe('rc.0'); }); - it('should reject dryrun with prerelease . version with patch different from 0', () => { - function testInvalidFunction() { - parseVersion('0.20.3-rc.0', 'dry-run'); - } - expect(testInvalidFunction).toThrowErrorMatchingInlineSnapshot( - `"Version 0.20.3-rc.0 is not valid for dry-runs"`, - ); - }); - it('should parse dryrun with prerelease - version', () => { const {version, major, minor, patch, prerelease} = parseVersion( '0.20.0-rc-0', @@ -254,15 +236,6 @@ describe('version-utils', () => { expect(prerelease).toBe('rc-0'); }); - it('should reject dryrun with prerelease - version with patch different from 0', () => { - function testInvalidFunction() { - parseVersion('0.20.3-rc-0', 'dry-run'); - } - expect(testInvalidFunction).toThrowErrorMatchingInlineSnapshot( - `"Version 0.20.3-rc-0 is not valid for dry-runs"`, - ); - }); - it('should parse dryrun with main version', () => { const {version, major, minor, patch, prerelease} = parseVersion( '1000.0.0', diff --git a/scripts/version-utils.js b/scripts/version-utils.js index 661eccb97c733f..826050ac0d0f4a 100644 --- a/scripts/version-utils.js +++ b/scripts/version-utils.js @@ -131,7 +131,7 @@ function isStablePrerelease(version) { return ( version.major === '0' && version.minor !== '0' && - version.patch === '0' && + version.patch.match(/^\d+$/) && version.prerelease != null && (version.prerelease.startsWith('rc.') || version.prerelease.startsWith('rc-') ||