mirror of
https://github.com/nestjs/nest.git
synced 2026-02-21 23:11:44 +00:00
Revert "Revert "fix(microservice) Delete unnecessary call of grpcClient.start""
This commit is contained in:
@@ -81,7 +81,6 @@ export class ServerGrpc extends Server implements CustomTransportStrategy {
|
||||
|
||||
public async start(callback?: () => void) {
|
||||
await this.bindEvents();
|
||||
this.grpcClient.start();
|
||||
callback();
|
||||
}
|
||||
|
||||
|
||||
@@ -51,13 +51,6 @@ describe('ServerGrpc', () => {
|
||||
await server.close();
|
||||
expect(bindEventsStub.called).to.be.true;
|
||||
});
|
||||
it('should call "client.start"', async () => {
|
||||
const client = { start: sinon.spy() };
|
||||
sinon.stub(server, 'createClient').callsFake(async () => client);
|
||||
|
||||
await server.listen(callback);
|
||||
expect(client.start.called).to.be.true;
|
||||
});
|
||||
it('should call callback', async () => {
|
||||
await server.listen(callback);
|
||||
await server.close();
|
||||
@@ -95,12 +88,6 @@ describe('ServerGrpc', () => {
|
||||
await serverMulti.close();
|
||||
expect(bindEventsStub.called).to.be.true;
|
||||
});
|
||||
it('should call "client.start"', async () => {
|
||||
const client = { start: sinon.spy() };
|
||||
sinon.stub(serverMulti, 'createClient').callsFake(async () => client);
|
||||
await serverMulti.listen(callback);
|
||||
expect(client.start.called).to.be.true;
|
||||
});
|
||||
it('should call callback', async () => {
|
||||
await serverMulti.listen(callback);
|
||||
await serverMulti.close();
|
||||
|
||||
Reference in New Issue
Block a user