Skip to content

Commit 06af474

Browse files
committed
test: fix assertion for standalone
1 parent 0a74415 commit 06af474

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

test/integration/connection-monitoring-and-pooling/rtt_pinger.test.ts

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import * as sinon from 'sinon';
55
import { type MongoClient } from '../../mongodb';
66
import { sleep } from '../../tools/utils';
77

8-
describe('class RTTPinger', () => {
8+
describe.only('class RTTPinger', () => {
99
afterEach(() => sinon.restore());
1010

1111
context('when serverApi is enabled', () => {
@@ -42,7 +42,7 @@ describe('class RTTPinger', () => {
4242

4343
await sleep(11); // allow for another ping after spies have been made
4444

45-
expect(spies).to.have.length.above(1);
45+
expect(spies).to.have.lengthOf.at.least(1);
4646
for (const spy of spies) {
4747
expect(spy).to.have.been.calledWith(sinon.match.any, { hello: 1 }, sinon.match.any);
4848
}
@@ -70,14 +70,14 @@ describe('class RTTPinger', () => {
7070

7171
await sleep(11); // rttPinger connection creation
7272

73-
const spies = rttPingers.map(rtt =>
74-
sinon.stub(rtt.connection!, 'command').yieldsRight(new Error('any'))
75-
);
76-
const destroySpies = rttPingers.map(rtt => sinon.spy(rtt.connection!, 'destroy'));
73+
for (const rtt of rttPingers)
74+
sinon.stub(rtt.connection!, 'command').yieldsRight(new Error('any'));
75+
76+
const spies = rttPingers.map(rtt => sinon.spy(rtt.connection!, 'destroy'));
7777

7878
await sleep(11); // allow for another ping after spies have been made
7979

80-
expect(destroySpies).to.have.length.above(1);
80+
expect(spies).to.have.lengthOf.at.least(1);
8181
for (const spy of spies) {
8282
expect(spy).to.have.been.called;
8383
}

0 commit comments

Comments
 (0)