@@ -5789,7 +5789,7 @@ describe('::withUsageExtensions', () => {
57895789
57905790 it ( 'appends passed parameter to consistent usage string template' , async ( ) => {
57915791 expect . hasAssertions ( ) ;
5792- expect ( withUsageExtensions ( 'new description' ) ) . toBe (
5792+ expect ( withUsageExtensions ( { altDescription : 'new description' } ) ) . toBe (
57935793 'Usage: $000 [...options]\n\nnew description.'
57945794 ) ;
57955795 } ) ;
@@ -5801,11 +5801,11 @@ describe('::withUsageExtensions', () => {
58015801new description
58025802` ;
58035803
5804- expect ( withUsageExtensions ( expected , { trim : true } ) ) . toBe (
5804+ expect ( withUsageExtensions ( { altDescription : expected , trim : true } ) ) . toBe (
58055805 `Usage: $000 [...options]\n\n${ expected . trim ( ) } .`
58065806 ) ;
58075807
5808- expect ( withUsageExtensions ( expected , { trim : false } ) ) . toBe (
5808+ expect ( withUsageExtensions ( { altDescription : expected , trim : false } ) ) . toBe (
58095809 `Usage: $000 [...options]\n\n${ expected } .`
58105810 ) ;
58115811 } ) ;
@@ -5817,11 +5817,11 @@ new description
58175817new description
58185818` ;
58195819
5820- expect ( withUsageExtensions ( expected , { appendPeriod : true } ) ) . toBe (
5820+ expect ( withUsageExtensions ( { altDescription : expected , appendPeriod : true } ) ) . toBe (
58215821 `Usage: $000 [...options]\n\n${ expected . trim ( ) } .`
58225822 ) ;
58235823
5824- expect ( withUsageExtensions ( expected , { appendPeriod : false } ) ) . toBe (
5824+ expect ( withUsageExtensions ( { altDescription : expected , appendPeriod : false } ) ) . toBe (
58255825 `Usage: $000 [...options]\n\n${ expected . trim ( ) } `
58265826 ) ;
58275827 } ) ;
@@ -5833,17 +5833,21 @@ new description
58335833new description
58345834` ;
58355835
5836- expect ( withUsageExtensions ( expected , { prependNewlines : true } ) ) . toBe (
5837- `Usage: $000 [...options]\n\n ${ expected . trim ( ) } .`
5838- ) ;
5836+ expect (
5837+ withUsageExtensions ( { altDescription : expected , prependNewlines : true } )
5838+ ) . toBe ( `Usage: $000 [...options]\n\n ${ expected . trim ( ) } .` ) ;
58395839
5840- expect ( withUsageExtensions ( expected , { prependNewlines : false } ) ) . toBe (
5841- `Usage: $000 ${ expected . trim ( ) } .`
5842- ) ;
5840+ expect (
5841+ withUsageExtensions ( { altDescription : expected , prependNewlines : false } )
5842+ ) . toBe ( `Usage: $000 ${ expected . trim ( ) } .` ) ;
58435843
5844- expect ( withUsageExtensions ( expected , { prependNewlines : false , trim : false } ) ) . toBe (
5845- `Usage: $000${ expected } .`
5846- ) ;
5844+ expect (
5845+ withUsageExtensions ( {
5846+ altDescription : expected ,
5847+ prependNewlines : false ,
5848+ trim : false
5849+ } )
5850+ ) . toBe ( `Usage: $000${ expected } .` ) ;
58475851 } ) ;
58485852
58495853 it ( 'respects "includeOptions" option' , async ( ) => {
@@ -5854,15 +5858,23 @@ new description
58545858` ;
58555859
58565860 expect (
5857- withUsageExtensions ( expected , { includeOptions : true , prependNewlines : false } )
5861+ withUsageExtensions ( {
5862+ altDescription : expected ,
5863+ includeOptions : true ,
5864+ prependNewlines : false
5865+ } )
58585866 ) . toBe ( `Usage: $000 [...options]${ expected . trim ( ) } .` ) ;
58595867
5860- expect ( withUsageExtensions ( expected , { includeOptions : false } ) ) . toBe (
5861- `Usage: $000\n\n ${ expected . trim ( ) } .`
5862- ) ;
5868+ expect (
5869+ withUsageExtensions ( { altDescription : expected , includeOptions : false } )
5870+ ) . toBe ( `Usage: $000\n\n ${ expected . trim ( ) } .` ) ;
58635871
58645872 expect (
5865- withUsageExtensions ( expected , { includeOptions : false , prependNewlines : true } )
5873+ withUsageExtensions ( {
5874+ altDescription : expected ,
5875+ includeOptions : false ,
5876+ prependNewlines : true
5877+ } )
58665878 ) . toBe ( `Usage: $000\n\n${ expected . trim ( ) } .` ) ;
58675879 } ) ;
58685880
@@ -5873,17 +5885,17 @@ new description
58735885new description
58745886` ;
58755887
5876- expect ( withUsageExtensions ( expected , { includeSubCommand : true } ) ) . toBe (
5877- `Usage: $000 [subcommand] [...options]\n ${ expected . trimEnd ( ) } .`
5878- ) ;
5888+ expect (
5889+ withUsageExtensions ( { altDescription : expected , includeSubCommand : true } )
5890+ ) . toBe ( `Usage: $000 [subcommand] [...options]\n ${ expected . trimEnd ( ) } .` ) ;
58795891
5880- expect ( withUsageExtensions ( expected , { includeSubCommand : false } ) ) . toBe (
5881- `Usage: $000 [...options]\n\n ${ expected . trim ( ) } .`
5882- ) ;
5892+ expect (
5893+ withUsageExtensions ( { altDescription : expected , includeSubCommand : false } )
5894+ ) . toBe ( `Usage: $000 [...options]\n\n ${ expected . trim ( ) } .` ) ;
58835895
5884- expect ( withUsageExtensions ( expected , { includeSubCommand : 'required' } ) ) . toBe (
5885- `Usage: $000 <subcommand> [...options]\n ${ expected . trimEnd ( ) } .`
5886- ) ;
5896+ expect (
5897+ withUsageExtensions ( { altDescription : expected , includeSubCommand : 'required' } )
5898+ ) . toBe ( `Usage: $000 <subcommand> [...options]\n ${ expected . trimEnd ( ) } .` ) ;
58875899 } ) ;
58885900
58895901 it ( 'respects "includeOptions" + "includeSubCommand" options together' , async ( ) => {
@@ -5894,15 +5906,24 @@ new description
58945906` ;
58955907
58965908 expect (
5897- withUsageExtensions ( expected , { includeOptions : true , includeSubCommand : true } )
5909+ withUsageExtensions ( {
5910+ altDescription : expected ,
5911+ includeOptions : true ,
5912+ includeSubCommand : true
5913+ } )
58985914 ) . toBe ( `Usage: $000 [subcommand] [...options]\n${ expected . trimEnd ( ) } .` ) ;
58995915
59005916 expect (
5901- withUsageExtensions ( expected , { includeOptions : true , includeSubCommand : false } )
5917+ withUsageExtensions ( {
5918+ altDescription : expected ,
5919+ includeOptions : true ,
5920+ includeSubCommand : false
5921+ } )
59025922 ) . toBe ( `Usage: $000 [...options]\n${ expected . trimEnd ( ) } .` ) ;
59035923
59045924 expect (
5905- withUsageExtensions ( expected , {
5925+ withUsageExtensions ( {
5926+ altDescription : expected ,
59065927 includeOptions : true ,
59075928 includeSubCommand : 'required'
59085929 } )
@@ -5916,7 +5937,9 @@ new description
59165937 const str =
59175938 "$1.\n\nAdditional description text that only appears in this command's help text." ;
59185939
5919- expect ( withUsageExtensions ( str ) ) . toBe ( `Usage: $000 [...options]\n\n${ str } ` ) ;
5940+ expect ( withUsageExtensions ( { altDescription : str } ) ) . toBe (
5941+ `Usage: $000 [...options]\n\n${ str } `
5942+ ) ;
59205943 } ) ;
59215944 } ) ;
59225945} ) ;
0 commit comments