Skip to content

Commit

Permalink
Merge pull request #1333 from eauc/master
Browse files Browse the repository at this point in the history
Fix issue #1332 : little bug in spy.printf "%*" formatter.
  • Loading branch information
fatso83 committed Mar 15, 2017
2 parents 2058030 + 031fad9 commit fc749fa
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
2 changes: 1 addition & 1 deletion lib/sinon/spy-formatters.js
Expand Up @@ -95,6 +95,6 @@ module.exports = {
},

"*": function (spyInstance, args) {
return args.map(sinonFormat).join(", ");
return args.map(function (arg) { return sinonFormat(arg); }).join(", ");
}
};
10 changes: 10 additions & 0 deletions test/call-test.js
Expand Up @@ -1282,6 +1282,16 @@ describe("sinonSpy.call", function () {

assert.equals(spy.printf("%λ"), "%λ");
});

it("*", function () {
var spy = sinonSpy();

assert.equals(
spy.printf("%*", 1.4567, "a", true, {}, [], undefined, null),
"1.4567, a, true, { }, [], undefined, null"
);
assert.equals(spy.printf("%*", "a", "b", "c"), "a, b, c");
});
});

it("captures a stack trace", function () {
Expand Down

0 comments on commit fc749fa

Please sign in to comment.