File tree Expand file tree Collapse file tree 1 file changed +10
-1
lines changed
packages/nest-commander-testing/src Expand file tree Collapse file tree 1 file changed +10
-1
lines changed Original file line number Diff line number Diff line change @@ -67,13 +67,22 @@ export class CommandTestFactory {
6767 }
6868
6969 static async run ( app : TestingModule , args : string [ ] = [ ] ) {
70+ const application = await this . runApplication ( app , args ) ;
71+ await application . close ( ) ;
72+ }
73+
74+ static async runWithoutClosing ( app : TestingModule , args : string [ ] = [ ] ) {
75+ return this . runApplication ( app , args ) ;
76+ }
77+
78+ private static async runApplication ( app : TestingModule , args : string [ ] = [ ] ) {
7079 if ( args ?. length && args [ 0 ] !== 'node' ) {
7180 args = [ 'node' , randomBytes ( 8 ) . toString ( 'hex' ) + '.js' ] . concat ( args ) ;
7281 }
7382 await app . init ( ) ;
7483 const runner = app . get ( CommandRunnerService ) ;
7584 await runner . run ( args ) ;
76- await app . close ( ) ;
85+ return app ;
7786 }
7887
7988 static setAnswers ( value : any | any [ ] ) : void {
You can’t perform that action at this time.
0 commit comments