Skip to content

Commit

Permalink
Account for argument formatting in newer Sinon versions
Browse files Browse the repository at this point in the history
This is a bit of a regression imo on Sinon's part, but I don't see an
easy way to adjust for it
  • Loading branch information
cincodenada committed Nov 2, 2021
1 parent c1cec44 commit 34ae581
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions test/messages.js
Original file line number Diff line number Diff line change
Expand Up @@ -111,22 +111,22 @@ describe("Messages", function () {

expect(function () {
spyA.should.have.been.calledBefore(spyB);
}).to.throw("expected spyA to have been called before function spyB() {}");
}).to.throw(/expected spyA to have been called before (function spyB\(\) \{\}|\[Function\])/);

if (spyA.calledImmediatelyBefore) {
expect(function () {
spyA.should.have.been.calledImmediatelyBefore(spyB);
}).to.throw("expected spyA to have been called immediately before function spyB() {}");
}).to.throw(/expected spyA to have been called immediately before (function spyB\(\) \{\}|\[Function\])/);
}

expect(function () {
spyB.should.have.been.calledAfter(spyA);
}).to.throw("expected spyB to have been called after function spyA() {}");
}).to.throw(/expected spyB to have been called after (function spyA() {}|\[Function\])/);

if (spyB.calledImmediatelyAfter) {
expect(function () {
spyB.should.have.been.calledImmediatelyAfter(spyA);
}).to.throw("expected spyB to have been called immediately after function spyA() {}");
}).to.throw(/expected spyB to have been called immediately after (function spyA() {}|\[Function\])/);
}
});

Expand All @@ -142,22 +142,22 @@ describe("Messages", function () {

expect(function () {
spyA.should.not.have.been.calledBefore(spyB);
}).to.throw("expected spyA to not have been called before function spyB() {}");
}).to.throw(/expected spyA to not have been called before (function spyB() {}|\[Function\])/);

if (spyA.calledImmediatelyBefore) {
expect(function () {
spyA.should.not.have.been.calledImmediatelyBefore(spyB);
}).to.throw("expected spyA to not have been called immediately before function spyB() {}");
}).to.throw(/expected spyA to not have been called immediately before (function spyB() {}|\[Function\])/);
}

expect(function () {
spyB.should.not.have.been.calledAfter(spyA);
}).to.throw("expected spyB to not have been called after function spyA() {}");
}).to.throw(/expected spyB to not have been called after (function spyA() {}|\[Function\])/);

if (spyB.calledImmediatelyAfter) {
expect(function () {
spyB.should.not.have.been.calledImmediatelyAfter(spyA);
}).to.throw("expected spyB to not have been called immediately after function spyA() {}");
}).to.throw(/expected spyB to not have been called immediately after (function spyA() {}|\[Function\])/);
}
});
});
Expand Down

0 comments on commit 34ae581

Please sign in to comment.