Skip to content

Commit

Permalink
Fix sinonjs#492 by upgrading formatio and setting a limit
Browse files Browse the repository at this point in the history
  • Loading branch information
mroderick committed Jul 30, 2014
1 parent 93b6338 commit 15a7e8e
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 2 deletions.
5 changes: 4 additions & 1 deletion lib/sinon.js
Original file line number Diff line number Diff line change
Expand Up @@ -363,7 +363,10 @@ var sinon = (function (formatio) {
}

if (formatio) {
var formatter = formatio.configure({ quoteStrings: false });
var formatter = formatio.configure({
quoteStrings: false,
limitChildrenCount: 250
});
sinon.format = function () {
return formatter.ascii.apply(formatter, arguments);
};
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
"prepublish": "./build"
},
"dependencies": {
"formatio": "~1.0",
"formatio": "~1.1.1",
"util": ">=0.10.3 <1"
},
"devDependencies": {
Expand Down
7 changes: 7 additions & 0 deletions test/sinon_test.js
Original file line number Diff line number Diff line change
Expand Up @@ -563,6 +563,13 @@ buster.testCase("sinon", {
assert.equals(sinon.format({ id: 42 }), "{ id: 42 }");
},

"// should configure formatio to use maximum 250 entries" : function(){
// not sure how we can verify this integration with the current setup
// where sinon.js calls formatio as part of it's loading
// extracting sinon.format into a separate module would make this a lot
// easier
},

"formats strings without quotes": function () {
assert.equals(sinon.format("Hey"), "Hey");
}
Expand Down

0 comments on commit 15a7e8e

Please sign in to comment.