Skip to content

Commit 34ae581

Browse files
committed
Account for argument formatting in newer Sinon versions
This is a bit of a regression imo on Sinon's part, but I don't see an easy way to adjust for it
1 parent c1cec44 commit 34ae581

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

test/messages.js

+8-8
Original file line numberDiff line numberDiff line change
@@ -111,22 +111,22 @@ describe("Messages", function () {
111111

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

116116
if (spyA.calledImmediatelyBefore) {
117117
expect(function () {
118118
spyA.should.have.been.calledImmediatelyBefore(spyB);
119-
}).to.throw("expected spyA to have been called immediately before function spyB() {}");
119+
}).to.throw(/expected spyA to have been called immediately before (function spyB\(\) \{\}|\[Function\])/);
120120
}
121121

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

126126
if (spyB.calledImmediatelyAfter) {
127127
expect(function () {
128128
spyB.should.have.been.calledImmediatelyAfter(spyA);
129-
}).to.throw("expected spyB to have been called immediately after function spyA() {}");
129+
}).to.throw(/expected spyB to have been called immediately after (function spyA() {}|\[Function\])/);
130130
}
131131
});
132132

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

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

147147
if (spyA.calledImmediatelyBefore) {
148148
expect(function () {
149149
spyA.should.not.have.been.calledImmediatelyBefore(spyB);
150-
}).to.throw("expected spyA to not have been called immediately before function spyB() {}");
150+
}).to.throw(/expected spyA to not have been called immediately before (function spyB() {}|\[Function\])/);
151151
}
152152

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

157157
if (spyB.calledImmediatelyAfter) {
158158
expect(function () {
159159
spyB.should.not.have.been.calledImmediatelyAfter(spyA);
160-
}).to.throw("expected spyB to not have been called immediately after function spyA() {}");
160+
}).to.throw(/expected spyB to not have been called immediately after (function spyA() {}|\[Function\])/);
161161
}
162162
});
163163
});

0 commit comments

Comments
 (0)