@@ -471,14 +471,18 @@ describe('main binary', function () {
471471 } ) ;
472472
473473 describe ( 'RELEASE.md' , function ( ) {
474- function expectedReleaseContents ( isYarn ) {
474+ function expectedReleaseContents ( packageManager = 'npm' ) {
475475 let releaseContents = fs . readFileSync ( path . join ( __dirname , '..' , 'release-template.md' ) , {
476476 encoding : 'utf8' ,
477477 } ) ;
478478
479- let dependencyInstallReplacementValue = isYarn ? 'yarn install' : 'npm install' ;
479+ let dependencyInstallReplacementValue = `${ packageManager } install` ;
480+ let releaseCommandReplacementValue =
481+ packageManager === 'pnpm' ? 'pnpm exec release-it' : 'npx release-it' ;
480482
481- return releaseContents . replace ( '{{INSTALL_DEPENDENCIES}}' , dependencyInstallReplacementValue ) ;
483+ return releaseContents
484+ . replace ( '{{INSTALL_DEPENDENCIES}}' , dependencyInstallReplacementValue )
485+ . replace ( '{{RELEASE_COMMAND}}' , releaseCommandReplacementValue ) ;
482486 }
483487
484488 it ( 'adds RELEASE.md to repo when no yarn.lock exists' , async function ( ) {
@@ -487,7 +491,7 @@ describe('main binary', function () {
487491 await exec ( [ '--no-install' , '--no-label-updates' ] ) ;
488492
489493 expect ( fs . readFileSync ( 'RELEASE.md' , { encoding : 'utf8' } ) ) . toBe (
490- expectedReleaseContents ( false )
494+ expectedReleaseContents ( 'npm' )
491495 ) ;
492496 } ) ;
493497
@@ -499,7 +503,19 @@ describe('main binary', function () {
499503 await exec ( [ '--no-install' , '--no-label-updates' ] ) ;
500504
501505 expect ( fs . readFileSync ( 'RELEASE.md' , { encoding : 'utf8' } ) ) . toBe (
502- expectedReleaseContents ( true )
506+ expectedReleaseContents ( 'yarn' )
507+ ) ;
508+ } ) ;
509+
510+ it ( 'adds RELEASE.md to repo when pnpm-lock.yaml exists' , async function ( ) {
511+ fs . writeFileSync ( 'pnpm-lock.yaml' , '' , { encoding : 'utf-8' } ) ;
512+
513+ expect ( fs . existsSync ( 'RELEASE.md' ) ) . toBeFalsy ( ) ;
514+
515+ await exec ( [ '--no-install' , '--no-label-updates' ] ) ;
516+
517+ expect ( fs . readFileSync ( 'RELEASE.md' , { encoding : 'utf8' } ) ) . toBe (
518+ expectedReleaseContents ( 'pnpm' )
503519 ) ;
504520 } ) ;
505521
@@ -515,7 +531,18 @@ describe('main binary', function () {
515531 await exec ( [ '--no-install' , '--no-label-updates' , '--update' ] ) ;
516532
517533 expect ( fs . readFileSync ( 'RELEASE.md' , { encoding : 'utf8' } ) ) . toBe (
518- expectedReleaseContents ( true )
534+ expectedReleaseContents ( 'yarn' )
535+ ) ;
536+ } ) ;
537+
538+ it ( 'updates RELEASE.md when pnpm-lock.yaml exists' , async function ( ) {
539+ fs . writeFileSync ( 'pnpm-lock.yaml' , '' , { encoding : 'utf-8' } ) ;
540+ fs . writeFileSync ( 'RELEASE.md' , 'lololol' , 'utf8' ) ;
541+
542+ await exec ( [ '--no-install' , '--no-label-updates' , '--update' ] ) ;
543+
544+ expect ( fs . readFileSync ( 'RELEASE.md' , { encoding : 'utf8' } ) ) . toBe (
545+ expectedReleaseContents ( 'pnpm' )
519546 ) ;
520547 } ) ;
521548
@@ -525,7 +552,7 @@ describe('main binary', function () {
525552 await exec ( [ '--no-install' , '--no-label-updates' , '--update' ] ) ;
526553
527554 expect ( fs . readFileSync ( 'RELEASE.md' , { encoding : 'utf8' } ) ) . toBe (
528- expectedReleaseContents ( false )
555+ expectedReleaseContents ( 'npm' )
529556 ) ;
530557 } ) ;
531558
0 commit comments