File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -352,10 +352,12 @@ export class Injector {
352352 modules . map ( ( module : Module ) => {
353353 const { relatedModules, exports } = module ;
354354 return this . flatMap (
355- [ ...relatedModules . values ( ) ] . filter ( related => {
356- const { metatype } = related ;
357- return exports . has ( metatype . name ) ;
358- } ) ,
355+ [ ...relatedModules . values ( ) ]
356+ . filter ( related => ! ! related )
357+ . filter ( related => {
358+ const { metatype } = related ;
359+ return exports . has ( metatype . name ) ;
360+ } ) ,
359361 ) ;
360362 } ) ,
361363 ) ;
Original file line number Diff line number Diff line change @@ -136,7 +136,7 @@ export class Module {
136136 name : EXPRESS_REF ,
137137 metatype : { } as any ,
138138 isResolved : true ,
139- instance : applicationRef ,
139+ instance : applicationRef || { } ,
140140 } ) ;
141141 }
142142
Original file line number Diff line number Diff line change @@ -28,8 +28,9 @@ export class ClientRedis extends ClientProxy {
2828 const pattern = JSON . stringify ( msg . pattern ) ;
2929 const responseCallback = ( channel , message ) => {
3030 const { err, response, disposed } = JSON . parse ( message ) ;
31- if ( disposed ) {
32- callback ( null , null , true ) ;
31+
32+ if ( disposed || err ) {
33+ callback ( err , null , true ) ;
3334 this . sub . unsubscribe ( this . getResPatternName ( pattern ) ) ;
3435 this . sub . removeListener ( MESSAGE_EVENT , responseCallback ) ;
3536 return ;
Original file line number Diff line number Diff line change @@ -54,10 +54,9 @@ export class ClientTCP extends ClientProxy {
5454
5555 public handleResponse ( socket , callback : ( ...args ) => any , buffer ) {
5656 const { err, response, disposed } = buffer ;
57- if ( disposed ) {
58- callback ( null , null , true ) ;
59- socket . end ( ) ;
60- return ;
57+ if ( disposed || err ) {
58+ callback ( err , null , true ) ;
59+ return socket . end ( ) ;
6160 }
6261 callback ( err , response ) ;
6362 }
Original file line number Diff line number Diff line change @@ -67,8 +67,7 @@ export class ServerRedis extends Server implements CustomTransportStrategy {
6767 const status = 'error' ;
6868
6969 if ( ! this . messageHandlers [ pattern ] ) {
70- publish ( { status, error : NO_PATTERN_MESSAGE } ) ;
71- return ;
70+ return publish ( { status, err : NO_PATTERN_MESSAGE } ) ;
7271 }
7372 const handler = this . messageHandlers [ pattern ] ;
7473 const response$ = this . transformToObservable (
Original file line number Diff line number Diff line change @@ -39,11 +39,10 @@ export class ServerTCP extends Server implements CustomTransportStrategy {
3939 public async handleMessage ( socket , msg : { pattern : any ; data : { } } ) {
4040 const pattern = JSON . stringify ( msg . pattern ) ;
4141 const status = 'error' ;
42+
4243 if ( ! this . messageHandlers [ pattern ] ) {
43- socket . sendMessage ( { status, error : NO_PATTERN_MESSAGE } ) ;
44- return ;
44+ return socket . sendMessage ( { status, err : NO_PATTERN_MESSAGE } ) ;
4545 }
46-
4746 const handler = this . messageHandlers [ pattern ] ;
4847 const response$ = this . transformToObservable (
4948 await handler ( msg . data ) ,
Original file line number Diff line number Diff line change @@ -23,6 +23,7 @@ export class TestingModule extends NestApplicationContext {
2323 public createNestApplication (
2424 expressInstance : any = express ( ) ,
2525 ) : INestApplication {
26+ this . container . setApplicationRef ( expressInstance ) ;
2627 return new NestApplication (
2728 this . container ,
2829 expressInstance ,
You can’t perform that action at this time.
0 commit comments