Skip to content

Commit

Permalink
Upgrade referee to v3
Browse files Browse the repository at this point in the history
  • Loading branch information
mantoni committed Dec 10, 2018
1 parent 2de949d commit 9741f41
Show file tree
Hide file tree
Showing 4 changed files with 27 additions and 18 deletions.
25 changes: 14 additions & 11 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@
},
"devDependencies": {
"@babel/core": "^7.1.6",
"@sinonjs/referee": "^2.5.2",
"@sinonjs/referee": "^3.0.0",
"babel-plugin-istanbul": "^5.1.0",
"babelify": "^10.0.0",
"browserify": "^16.2.3",
Expand Down
3 changes: 2 additions & 1 deletion test/sandbox-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,8 @@ referee.add("fakeServerWithClock", {
assert: function(obj, expected) {
return samsam.deepEqual(obj, expected) && fakeServer.create.calledOn(fakeServerWithClock);
},
assertMessage: "Expected object ${0} to be a fake server with clock"
assertMessage: "Expected object ${0} to be a fake server with clock",
refuteMessage: "Expected object ${0} not to be a fake server with clock"
});

describe("Sandbox", function() {
Expand Down
15 changes: 10 additions & 5 deletions test/test-helper.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,21 +6,24 @@ referee.add("spy", {
assert: function(obj) {
return obj !== null && typeof obj.calledWith === "function" && !obj.returns;
},
assertMessage: "Expected object ${0} to be a spy function"
assertMessage: "Expected object ${0} to be a spy function",
refuteMessage: "Expected object ${0} not to be a spy function"
});

referee.add("stub", {
assert: function(obj) {
return obj !== null && typeof obj.calledWith === "function" && typeof obj.returns === "function";
},
assertMessage: "Expected object ${0} to be a stub function"
assertMessage: "Expected object ${0} to be a stub function",
refuteMessage: "Expected object ${0} not to be a stub function"
});

referee.add("mock", {
assert: function(obj) {
return obj !== null && typeof obj.verify === "function" && typeof obj.expects === "function";
},
assertMessage: "Expected object ${0} to be a mock"
assertMessage: "Expected object ${0} to be a mock",
refuteMessage: "Expected object ${0} not to be a mock"
});

referee.add("fakeServer", {
Expand All @@ -31,12 +34,14 @@ referee.add("fakeServer", {
typeof obj.respondWith === "function"
);
},
assertMessage: "Expected object ${0} to be a fake server"
assertMessage: "Expected object ${0} to be a fake server",
refuteMessage: "Expected object ${0} not to be a fake server"
});

referee.add("clock", {
assert: function(obj) {
return obj !== null && typeof obj.tick === "function" && typeof obj.setTimeout === "function";
},
assertMessage: "Expected object ${0} to be a clock"
assertMessage: "Expected object ${0} to be a clock",
refuteMessage: "Expected object ${0} not to be a clock"
});

0 comments on commit 9741f41

Please sign in to comment.