File tree Expand file tree Collapse file tree 2 files changed +31
-1
lines changed
Expand file tree Collapse file tree 2 files changed +31
-1
lines changed Original file line number Diff line number Diff line change @@ -2282,7 +2282,7 @@ export function formatUpgradeResult(data: UpgradeResult): string {
22822282 // Append changelog if available
22832283 const changelogOutput = formatChangelog ( data ) ;
22842284 if ( changelogOutput ) {
2285- return `${ result } \n${ changelogOutput } ` ;
2285+ return `${ result } \n\n ${ changelogOutput } \n ` ;
22862286 }
22872287
22882288 return result ;
Original file line number Diff line number Diff line change @@ -817,4 +817,34 @@ describe("formatUpgradeResult", () => {
817817 expect ( result ) . not . toContain ( "(from" ) ;
818818 } ) ;
819819 } ) ;
820+
821+ test ( "changelog is separated from metadata by a blank line" , ( ) => {
822+ withPlain ( ( ) => {
823+ const result = formatUpgradeResult ( {
824+ action : "upgraded" ,
825+ currentVersion : "0.5.0" ,
826+ targetVersion : "0.6.0" ,
827+ channel : "stable" ,
828+ method : "curl" ,
829+ forced : false ,
830+ changelog : {
831+ fromVersion : "0.5.0" ,
832+ toVersion : "0.6.0" ,
833+ sections : [
834+ { category : "features" , markdown : "- add cool feature (#1)" } ,
835+ ] ,
836+ totalItems : 1 ,
837+ truncated : false ,
838+ originalCount : 1 ,
839+ } ,
840+ } ) ;
841+ // Blank line between metadata and changelog heading
842+ expect ( result ) . toContain ( "Channel: stable\n\n" ) ;
843+ // Changelog content present
844+ expect ( result ) . toContain ( "New Features" ) ;
845+ expect ( result ) . toContain ( "add cool feature (#1)" ) ;
846+ // Trailing newline after changelog
847+ expect ( result ) . toMatch ( / \n $ / ) ;
848+ } ) ;
849+ } ) ;
820850} ) ;
You can’t perform that action at this time.
0 commit comments