File tree 2 files changed +14
-0
lines changed
2 files changed +14
-0
lines changed Original file line number Diff line number Diff line change @@ -81,6 +81,7 @@ export class ServerGrpc extends Server implements CustomTransportStrategy {
81
81
82
82
public async start ( callback ?: ( ) => void ) {
83
83
await this . bindEvents ( ) ;
84
+ this . grpcClient . start ( ) ;
84
85
callback ( ) ;
85
86
}
86
87
Original file line number Diff line number Diff line change @@ -51,6 +51,13 @@ describe('ServerGrpc', () => {
51
51
await server . close ( ) ;
52
52
expect ( bindEventsStub . called ) . to . be . true ;
53
53
} ) ;
54
+ it ( 'should call "client.start"' , async ( ) => {
55
+ const client = { start : sinon . spy ( ) } ;
56
+ sinon . stub ( server , 'createClient' ) . callsFake ( async ( ) => client ) ;
57
+
58
+ await server . listen ( callback ) ;
59
+ expect ( client . start . called ) . to . be . true ;
60
+ } ) ;
54
61
it ( 'should call callback' , async ( ) => {
55
62
await server . listen ( callback ) ;
56
63
await server . close ( ) ;
@@ -88,6 +95,12 @@ describe('ServerGrpc', () => {
88
95
await serverMulti . close ( ) ;
89
96
expect ( bindEventsStub . called ) . to . be . true ;
90
97
} ) ;
98
+ it ( 'should call "client.start"' , async ( ) => {
99
+ const client = { start : sinon . spy ( ) } ;
100
+ sinon . stub ( serverMulti , 'createClient' ) . callsFake ( async ( ) => client ) ;
101
+ await serverMulti . listen ( callback ) ;
102
+ expect ( client . start . called ) . to . be . true ;
103
+ } ) ;
91
104
it ( 'should call callback' , async ( ) => {
92
105
await serverMulti . listen ( callback ) ;
93
106
await serverMulti . close ( ) ;
You can’t perform that action at this time.
0 commit comments