Skip to content

Commit 4bb2baf

Browse files
fix: tests
1 parent 98dca2b commit 4bb2baf

File tree

2 files changed

+15
-0
lines changed

2 files changed

+15
-0
lines changed

__tests__/services/gateway-test.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,10 @@ describe('services/gateway', () => {
5151
const msName2 = 'ms2';
5252
const msHandler = () => new MicroserviceResponse() as unknown as Promise<MicroserviceResponse>;
5353

54+
before(() => {
55+
sinon.stub(process, 'exit');
56+
});
57+
5458
after(() => {
5559
sinon.restore();
5660
});

__tests__/services/socket-test.ts

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,15 @@ describe('services/socket', () => {
3939
middleware2: 'after',
4040
});
4141

42+
before(() => {
43+
sinon.stub(process, 'exit');
44+
//
45+
});
46+
47+
after(() => {
48+
sinon.restore();
49+
});
50+
4251
afterEach(() => {
4352
ms.removeMiddleware(middlewareHandlerAfter);
4453
ms.removeMiddleware(middlewareHandlerBefore);
@@ -231,6 +240,8 @@ describe('services/socket', () => {
231240
it('should correctly start microservice with async io params', async () => {
232241
const listenStub = sandbox.stub(ms.getIoServer(), 'listen');
233242

243+
sandbox.stub(ms.getHttpServer(), 'listen').returns({ close: sandbox.stub() } as never);
244+
234245
// Configure io server stubs
235246
const ioServerUseStub = sandbox.stub(ms.getIoServer(), 'use');
236247
const ioServerOnStub = sandbox.stub(ms.getIoServer(), 'on');

0 commit comments

Comments
 (0)