Skip to content

Commit

Permalink
test: fix assertion for standalone
Browse files Browse the repository at this point in the history
  • Loading branch information
nbbeeken committed Nov 10, 2023
1 parent 0a74415 commit 54c8af6
Showing 1 changed file with 6 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ describe('class RTTPinger', () => {

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

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

await sleep(11); // rttPinger connection creation

const spies = rttPingers.map(rtt =>
sinon.stub(rtt.connection!, 'command').yieldsRight(new Error('any'))
);
const destroySpies = rttPingers.map(rtt => sinon.spy(rtt.connection!, 'destroy'));
for (const rtt of rttPingers)
sinon.stub(rtt.connection!, 'command').yieldsRight(new Error('any'));

const spies = rttPingers.map(rtt => sinon.spy(rtt.connection!, 'destroy'));

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

expect(destroySpies).to.have.length.above(1);
expect(spies).to.have.lengthOf.at.least(1);
for (const spy of spies) {
expect(spy).to.have.been.called;
}
Expand Down

0 comments on commit 54c8af6

Please sign in to comment.