Skip to content

Commit e8068c2

Browse files
committed
cleaned server test
1 parent 712d8c4 commit e8068c2

File tree

2 files changed

+4
-14
lines changed

2 files changed

+4
-14
lines changed

test/unit/cmap/connection.test.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import { EventEmitter, once } from 'events';
33
import { Server } from 'http';
44
import { Socket } from 'net';
55
import * as sinon from 'sinon';
6-
import { Duplex, Readable } from 'stream';
6+
import { Readable } from 'stream';
77
import { setTimeout } from 'timers';
88
import { promisify } from 'util';
99

@@ -73,7 +73,7 @@ class FakeSocket extends EventEmitter {
7373
}
7474
}
7575

76-
class InputStream extends Duplex {
76+
class InputStream extends Readable {
7777
writableEnded: boolean;
7878
timeout = 0;
7979

test/unit/sdam/server.test.ts

Lines changed: 2 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -66,19 +66,9 @@ describe('Server', () => {
6666
);
6767
});
6868

69-
context.only('when a server is created', function () {
70-
let serverSpy;
71-
let server;
72-
beforeEach(function () {
73-
server = new Server(
74-
topologyWithPlaceholderClient([], {}),
75-
new ServerDescription('a:1'),
76-
{} as any
77-
);
78-
serverSpy = sinon.spy(server, 'command');
79-
});
80-
69+
context('when a server is created', function () {
8170
it('calls the command function through commandAsync', async function () {
71+
const serverSpy = sinon.spy(server, 'command');
8272
await server.commandAsync(ns('dummy'), { ping: 1 }, {});
8373
expect(serverSpy).to.have.been.calledOnce;
8474
});

0 commit comments

Comments
 (0)