Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for sinon v5 #122

Merged
merged 3 commits into from
May 23, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 5 additions & 3 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
language: node_js
node_js:
- 4
- 6
- 8
- 9
- 10
- stable
env:
# This matrix used to be larger. In 3.0.0 we moved to only supporting these versions.
# But, we'll retain the infrastructure for a larger matrix, in case we need it in the future.
- CHAI_VERSION=^4.0.0 SINON_VERSION=^5.0.0
- CHAI_VERSION=^4.0.0 SINON_VERSION=^4.0.0
script:
- npm run lint
Expand Down
108 changes: 56 additions & 52 deletions package-lock.json

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

6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,20 +23,20 @@
],
"scripts": {
"test": "mocha",
"test-travis": "npm install chai@$CHAI_VERSION && npm install sinon@$SINON_VERSION && npm install && npm test",
"test-travis": "npm install && npm install chai@$CHAI_VERSION && npm install sinon@$SINON_VERSION && npm test",
"lint": "eslint .",
"cover": "istanbul cover node_modules/mocha/bin/_mocha && opener ./coverage/lcov-report/lib/sinon-chai.js.html"
},
"peerDependencies": {
"chai": "^4.0.0",
"sinon": "^4.0.0"
"sinon": ">=4.0.0 <6.0.0"
},
"devDependencies": {
"chai": "^4.1.0",
"eslint": "^3.19.0",
"istanbul": "~0.4.5",
"mocha": "^3.4.2",
"opener": "^1.4.3",
"sinon": "^4.0.0"
"sinon": "^5.0.0"
}
}
12 changes: 6 additions & 6 deletions test/messages.js
Original file line number Diff line number Diff line change
Expand Up @@ -304,7 +304,7 @@ describe("Messages", function () {

describe("about returning", function () {
it("should be correct for the basic case", function () {
var spy = sinon.spy.create(function () {
var spy = sinon.spy(function () {
return 1;
});

Expand All @@ -319,7 +319,7 @@ describe("Messages", function () {
});

it("should be correct for the negated case", function () {
var spy = sinon.spy.create(function () {
var spy = sinon.spy(function () {
return 1;
});

Expand All @@ -334,7 +334,7 @@ describe("Messages", function () {
});

it("should be correct for the always case", function () {
var spy = sinon.spy.create(function () {
var spy = sinon.spy(function () {
return 1;
});

Expand All @@ -349,7 +349,7 @@ describe("Messages", function () {
describe("about throwing", function () {
it("should be correct for the basic cases", function () {
var spy = sinon.spy();
var throwingSpy = sinon.spy.create(function () {
var throwingSpy = sinon.spy(function () {
throw new Error();
});

Expand Down Expand Up @@ -380,7 +380,7 @@ describe("Messages", function () {

it("should be correct for the negated cases", function () {
var error = new Error("boo!");
var spy = sinon.spy.create(function () {
var spy = sinon.spy(function () {
throw error;
});

Expand Down Expand Up @@ -410,7 +410,7 @@ describe("Messages", function () {

it("should be correct for the always cases", function () {
var spy = sinon.spy();
var throwingSpy = sinon.spy.create(function () {
var throwingSpy = sinon.spy(function () {
throw new Error();
});

Expand Down
12 changes: 6 additions & 6 deletions test/returning.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ var expect = require("chai").expect;
describe("Returning", function () {
describe("returned", function () {
it("should throw an assertion error if the spy does not return the correct value", function () {
var spy = sinon.spy.create(function () {
var spy = sinon.spy(function () {
return 1;
});

Expand All @@ -22,7 +22,7 @@ describe("Returning", function () {
});

it("should not throw if the spy returns the correct value", function () {
var spy = sinon.spy.create(function () {
var spy = sinon.spy(function () {
return 1;
});

Expand All @@ -38,7 +38,7 @@ describe("Returning", function () {

it("should not throw if the spy returns the correct value amongst others", function () {
var values = [1, 2, 3];
var spy = sinon.spy.create(function () {
var spy = sinon.spy(function () {
return values[spy.callCount - 1];
});

Expand All @@ -57,7 +57,7 @@ describe("Returning", function () {

describe("always returned", function () {
it("should throw an assertion error if the spy does not return the correct value", function () {
var spy = sinon.spy.create(function () {
var spy = sinon.spy(function () {
return 1;
});

Expand All @@ -72,7 +72,7 @@ describe("Returning", function () {
});

it("should not throw if the spy returns the correct value", function () {
var spy = sinon.spy.create(function () {
var spy = sinon.spy(function () {
return 1;
});

Expand All @@ -88,7 +88,7 @@ describe("Returning", function () {

it("should throw an assertion error if the spy returns the correct value amongst others", function () {
var values = [1, 2, 3];
var spy = sinon.spy.create(function () {
var spy = sinon.spy(function () {
values[spy.callCount - 1];
});

Expand Down
Loading