diff --git a/packages/ckeditor5-dev-release-tools/lib/utils/getnpmtagfromversion.js b/packages/ckeditor5-dev-release-tools/lib/utils/getnpmtagfromversion.js index 8044fdd52..1a86f9663 100644 --- a/packages/ckeditor5-dev-release-tools/lib/utils/getnpmtagfromversion.js +++ b/packages/ckeditor5-dev-release-tools/lib/utils/getnpmtagfromversion.js @@ -21,5 +21,9 @@ export default function getNpmTagFromVersion( version ) { return 'nightly'; } + if ( versionTag.startsWith( 'internal' ) ) { + return 'internal'; + } + return versionTag; } diff --git a/packages/ckeditor5-dev-release-tools/tests/utils/getnpmtagfromversion.js b/packages/ckeditor5-dev-release-tools/tests/utils/getnpmtagfromversion.js index 38b0c823b..a9980ec6c 100644 --- a/packages/ckeditor5-dev-release-tools/tests/utils/getnpmtagfromversion.js +++ b/packages/ckeditor5-dev-release-tools/tests/utils/getnpmtagfromversion.js @@ -3,13 +3,10 @@ * For licensing, see LICENSE.md. */ -import { describe, it, expect, vi } from 'vitest'; -import semver from 'semver'; +import { describe, it, expect } from 'vitest'; import getNpmTagFromVersion from '../../lib/utils/getnpmtagfromversion.js'; -vi.mock( 'semver' ); - describe( 'getNpmTagFromVersion()', () => { it( 'should return "latest" when processing a X.Y.Z version', () => { expect( getNpmTagFromVersion( '1.0.0' ) ).to.equal( 'latest' ); @@ -18,16 +15,16 @@ describe( 'getNpmTagFromVersion()', () => { } ); it( 'should return "alpha" when processing a X.Y.Z-alpha.X version', () => { - vi.mocked( semver.prerelease ).mockReturnValue( [ 'alpha', 0 ] ); - expect( getNpmTagFromVersion( '1.0.0-alpha.0' ) ).to.equal( 'alpha' ); expect( getNpmTagFromVersion( '2.1.0-alpha.0' ) ).to.equal( 'alpha' ); expect( getNpmTagFromVersion( '3.2.1-alpha.0' ) ).to.equal( 'alpha' ); } ); it( 'should return "nightly" when processing a 0.0.0-nightly-YYYYMMDD.X version', () => { - vi.mocked( semver.prerelease ).mockReturnValue( [ 'nightly', 0 ] ); - expect( getNpmTagFromVersion( '0.0.0-nightly-20230517.0' ) ).to.equal( 'nightly' ); } ); + + it( 'should return "internal" when processing a 0.0.0-internal-YYYYMMDD.X version', () => { + expect( getNpmTagFromVersion( '0.0.0-internal-20230517.0' ) ).to.equal( 'internal' ); + } ); } );