@@ -46,13 +46,13 @@ describe('common release action logic', () => {
4646 } ) ;
4747
4848 describe ( 'version computation' , ( ) => {
49- const testReleaseTrain = new ActiveReleaseTrains ( {
50- releaseCandidate : new ReleaseTrain ( '10.1.x' , parse ( '10.1.0-next.3' ) ) ,
51- next : new ReleaseTrain ( 'master' , parse ( '10.2.0-next.0' ) ) ,
52- latest : new ReleaseTrain ( '10.0.x' , parse ( '10.0.1' ) ) ,
53- } ) ;
54-
5549 it ( 'should not modify release train versions and cause invalid other actions' , async ( ) => {
50+ const testReleaseTrain = new ActiveReleaseTrains ( {
51+ releaseCandidate : new ReleaseTrain ( '10.1.x' , parse ( '10.1.0-next.3' ) ) ,
52+ next : new ReleaseTrain ( 'master' , parse ( '10.2.0-next.0' ) ) ,
53+ latest : new ReleaseTrain ( '10.0.x' , parse ( '10.0.1' ) ) ,
54+ } ) ;
55+
5656 const { releaseConfig, githubConfig} = getTestConfigurationsForAction ( ) ;
5757 const gitClient = getMockGitClient ( githubConfig , /* useSandboxGitClient */ false ) ;
5858 const descriptions : string [ ] = [ ] ;
@@ -74,6 +74,35 @@ describe('common release action logic', () => {
7474 `Cut a new release for an active LTS branch (0 active).` ,
7575 ] ) ;
7676 } ) ;
77+
78+ it ( 'should properly show descriptions when a major is in RC-phase' , async ( ) => {
79+ const testReleaseTrain = new ActiveReleaseTrains ( {
80+ releaseCandidate : new ReleaseTrain ( '15.0.x' , parse ( '15.0.0-rc.1' ) ) ,
81+ next : new ReleaseTrain ( 'main' , parse ( '15.1.0-next.0' ) ) ,
82+ latest : new ReleaseTrain ( '14.3.x' , parse ( '14.3.1' ) ) ,
83+ } ) ;
84+
85+ const { releaseConfig, githubConfig} = getTestConfigurationsForAction ( ) ;
86+ const gitClient = getMockGitClient ( githubConfig , /* useSandboxGitClient */ false ) ;
87+ const descriptions : string [ ] = [ ] ;
88+
89+ // Fake the NPM package request as otherwise the test would rely on `npmjs.org`.
90+ fakeNpmPackageQueryRequest ( releaseConfig . representativeNpmPackage , { 'dist-tags' : { } } ) ;
91+
92+ for ( const actionCtor of actions ) {
93+ if ( await actionCtor . isActive ( testReleaseTrain , releaseConfig ) ) {
94+ const action = new actionCtor ( testReleaseTrain , gitClient , releaseConfig , testTmpDir ) ;
95+ descriptions . push ( await action . getDescription ( ) ) ;
96+ }
97+ }
98+
99+ expect ( descriptions ) . toEqual ( [
100+ 'Cut a stable release for the release-candidate branch — published as `@next` (v15.0.0).' ,
101+ 'Cut a new patch release for the "14.3.x" branch (v14.3.2).' ,
102+ `Cut a new next pre-release for the "15.0.x" branch (v15.0.0-rc.2).` ,
103+ `Cut a new release for an active LTS branch (0 active).` ,
104+ ] ) ;
105+ } ) ;
77106 } ) ;
78107
79108 describe ( 'publishing' , ( ) => {
0 commit comments