Skip to content

Commit

Permalink
Repairs one test to allow it to detect the bug.
Browse files Browse the repository at this point in the history
  • Loading branch information
hrimhari committed Mar 27, 2017
1 parent 917ac62 commit 217a032
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion test/mock-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -475,6 +475,17 @@ describe("sinonMock", function () {
});

describe(".withArgs", function () {
var expectedException = function (name) {
return {
test: function (actual) {
return actual.name === name;
},
toString: function () {
return name;
}
};
};

it("returns expectation for chaining", function () {
assert.same(this.expectation.withArgs(1), this.expectation);
});
Expand Down Expand Up @@ -510,7 +521,7 @@ describe("sinonMock", function () {

assert.exception(function () {
expectation(2, 2, 3);
}, "ExpectationError");
}, expectedException("ExpectationError"));
});

it("allows excessive args", function () {
Expand Down

0 comments on commit 217a032

Please sign in to comment.