Skip to content

Commit b624d0b

Browse files
Merge pull request nestjs#5 from ThomRick/master
fix sinon deprecated warnings
2 parents 43691fb + 06339a4 commit b624d0b

2 files changed

Lines changed: 5 additions & 5 deletions

File tree

src/microservices/test/server/server-redis.spec.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ describe('ServerRedis', () => {
1818
client = {
1919
on: onSpy
2020
};
21-
createRedisClient = sinon.stub(server, 'createRedisClient', () => client);
21+
createRedisClient = sinon.stub(server, 'createRedisClient').callsFake(() => client);
2222
});
2323
it('should bind "connect" event to handler', () => {
2424
server.listen(null);
@@ -71,8 +71,8 @@ describe('ServerRedis', () => {
7171

7272
beforeEach(() => {
7373
getPublisherSpy = sinon.spy();
74-
sinon.stub(server, 'getPublisher', () => getPublisherSpy);
75-
sinon.stub(server, 'tryParse', () => ({ data }))
74+
sinon.stub(server, 'getPublisher').callsFake(() => getPublisherSpy);
75+
sinon.stub(server, 'tryParse').callsFake(() => ({ data }));
7676
});
7777
it(`should publish NO_PATTERN_MESSAGE if pattern not exists in msgHandlers object`, () => {
7878
server.handleMessage(channel, {}, null);
@@ -92,7 +92,7 @@ describe('ServerRedis', () => {
9292
let publisherSpy: sinon.SinonSpy, handler;
9393
beforeEach(() => {
9494
publisherSpy = sinon.spy();
95-
sinon.stub(server, 'getPublisher', () => publisherSpy);
95+
sinon.stub(server, 'getPublisher').callsFake(() => publisherSpy);
9696
handler = server.getMessageHandlerCallback(null, null);
9797
});
9898
it(`should return function`, () => {

src/microservices/test/server/server-tcp.spec.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ describe('ServerTCP', () => {
1313
let getSocketInstance;
1414
const socket = { on: sinon.spy() };
1515
beforeEach(() => {
16-
getSocketInstance = sinon.stub(server, 'getSocketInstance', () => socket);
16+
getSocketInstance = sinon.stub(server, 'getSocketInstance').callsFake(() => socket);
1717
});
1818
it('should bind message event to handler', () => {
1919
server.bindHandler(null);

0 commit comments

Comments
 (0)