Skip to content

Commit 33f0163

Browse files
committed
Update @sinonjs/referee and fix deprecations
1 parent 6caa89b commit 33f0163

File tree

8 files changed

+45
-45
lines changed

8 files changed

+45
-45
lines changed

package-lock.json

Lines changed: 4 additions & 4 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@
6666
},
6767
"devDependencies": {
6868
"@babel/core": "^7.3.3",
69-
"@sinonjs/referee": "^3.1.1",
69+
"@sinonjs/referee": "^3.2.0",
7070
"babel-plugin-istanbul": "^5.1.1",
7171
"babelify": "^10.0.0",
7272
"browserify": "^16.2.3",

test/call-test.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1215,7 +1215,7 @@ describe("sinonSpy.call", function() {
12151215
sinonSpy(myObj, "ouch");
12161216
});
12171217

1218-
refute.defined(myObj.ouch);
1218+
assert.isUndefined(myObj.ouch);
12191219
});
12201220

12211221
it("throws if spying on non-existent object", function() {

test/fake-test.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -156,7 +156,7 @@ describe("fake", function() {
156156
assert.equals(f.lastArg, false);
157157

158158
f();
159-
refute.defined(f.lastArg);
159+
assert.isUndefined(f.lastArg);
160160
});
161161
});
162162

test/sandbox-test.js

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1832,10 +1832,10 @@ describe("Sandbox", function() {
18321832
assert.equals(sandbox.args.length, 0);
18331833
assert.equals(object.server, this.fakeServer);
18341834
assert.clock(object.clock);
1835-
refute.defined(object.spy);
1836-
refute.defined(object.stub);
1837-
refute.defined(object.mock);
1838-
refute.defined(object.requests);
1835+
assert.isUndefined(object.spy);
1836+
assert.isUndefined(object.stub);
1837+
assert.isUndefined(object.mock);
1838+
assert.isUndefined(object.requests);
18391839

18401840
sandbox.restore();
18411841
});
@@ -1858,7 +1858,7 @@ describe("Sandbox", function() {
18581858
assert.isFunction(object.stub);
18591859
assert.isFunction(object.mock);
18601860
assert.isArray(object.requests);
1861-
refute.defined(object.sandbox);
1861+
assert.isUndefined(object.sandbox);
18621862

18631863
sandbox.restore();
18641864
});

test/spy-test.js

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -255,7 +255,7 @@ describe("spy", function() {
255255
it("does not define create method", function() {
256256
var spy = createSpy.create();
257257

258-
refute.defined(spy.create);
258+
assert.isUndefined(spy.create);
259259
});
260260

261261
it("does not overwrite original create property", function() {
@@ -351,15 +351,15 @@ describe("spy", function() {
351351
assert.equals(spy.withArgs(1, 2).callCount, 1);
352352

353353
// assert call
354-
refute.defined(spy.getCall(0).args[0]);
354+
assert.isUndefined(spy.getCall(0).args[0]);
355355
assert.equals(spy.getCall(1).args[0], 1);
356-
refute.defined(spy.getCall(1).args[1]);
356+
assert.isUndefined(spy.getCall(1).args[1]);
357357
assert.equals(spy.getCall(2).args[0], 1);
358358
assert.equals(spy.getCall(2).args[1], 1);
359-
refute.defined(spy.getCall(2).args[2]);
359+
assert.isUndefined(spy.getCall(2).args[2]);
360360
assert.equals(spy.getCall(3).args[0], 1);
361361
assert.equals(spy.getCall(3).args[1], 2);
362-
refute.defined(spy.getCall(3).args[2]);
362+
assert.isUndefined(spy.getCall(3).args[2]);
363363
["args", "callCount", "callId"].forEach(function(propName) {
364364
assert.equals(spy.withArgs(1).getCall(0)[propName], spy.getCall(1)[propName]);
365365
assert.equals(spy.withArgs(1).getCall(1)[propName], spy.getCall(2)[propName]);
@@ -1531,7 +1531,7 @@ describe("spy", function() {
15311531
this.spy();
15321532

15331533
assert.equals(this.spy.exceptions.length, 1);
1534-
refute.defined(this.spy.exceptions[0]);
1534+
assert.isUndefined(this.spy.exceptions[0]);
15351535
});
15361536

15371537
it("stacks up exceptions and undefined", function() {
@@ -1557,11 +1557,11 @@ describe("spy", function() {
15571557
spy();
15581558

15591559
assert.equals(spy.exceptions.length, 5);
1560-
refute.defined(spy.exceptions[0]);
1560+
assert.isUndefined(spy.exceptions[0]);
15611561
assert.equals(spy.exceptions[1], err);
1562-
refute.defined(spy.exceptions[2]);
1562+
assert.isUndefined(spy.exceptions[2]);
15631563
assert.equals(spy.exceptions[3], err);
1564-
refute.defined(spy.exceptions[4]);
1564+
assert.isUndefined(spy.exceptions[4]);
15651565
});
15661566
});
15671567

@@ -1665,7 +1665,7 @@ describe("spy", function() {
16651665
spy();
16661666

16671667
assert.equals(spy.returnValues.length, 1);
1668-
refute.defined(spy.returnValues[0]);
1668+
assert.isUndefined(spy.returnValues[0]);
16691669
});
16701670

16711671
it("contains return value", function() {
@@ -1688,7 +1688,7 @@ describe("spy", function() {
16881688
assert.exception(spy);
16891689

16901690
assert.equals(spy.returnValues.length, 1);
1691-
refute.defined(spy.returnValues[0]);
1691+
assert.isUndefined(spy.returnValues[0]);
16921692
});
16931693

16941694
it("contains the created object for spied constructors", function() {
@@ -1742,11 +1742,11 @@ describe("spy", function() {
17421742
spy();
17431743

17441744
assert.equals(spy.returnValues.length, 5);
1745-
refute.defined(spy.returnValues[0]);
1745+
assert.isUndefined(spy.returnValues[0]);
17461746
assert.equals(spy.returnValues[1], 2);
1747-
refute.defined(spy.returnValues[2]);
1747+
assert.isUndefined(spy.returnValues[2]);
17481748
assert.equals(spy.returnValues[3], 4);
1749-
refute.defined(spy.returnValues[4]);
1749+
assert.isUndefined(spy.returnValues[4]);
17501750
});
17511751
});
17521752

test/stub-test.js

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -128,7 +128,7 @@ describe("stub", function() {
128128
it("returns undefined", function() {
129129
var stub = createStub.create();
130130

131-
refute.defined(stub());
131+
assert.isUndefined(stub());
132132
});
133133

134134
it("supersedes previous throws", function() {
@@ -794,7 +794,7 @@ describe("stub", function() {
794794

795795
assert.exception(stub);
796796

797-
refute.defined(stub.invoking);
797+
assert.isUndefined(stub.invoking);
798798
});
799799
});
800800

@@ -1441,7 +1441,7 @@ describe("stub", function() {
14411441
createStub(myObj, "ouch");
14421442
});
14431443

1444-
refute.defined(myObj.ouch);
1444+
assert.isUndefined(myObj.ouch);
14451445
});
14461446
});
14471447

@@ -2504,7 +2504,7 @@ describe("stub", function() {
25042504

25052505
assert.same(stub(5), 1);
25062506
assert.same(stub(5), 2);
2507-
refute.defined(stub(5));
2507+
assert.isUndefined(stub(5));
25082508
});
25092509

25102510
it("does not create undefined behaviour just by calling onCall", function() {
@@ -2525,13 +2525,13 @@ describe("stub", function() {
25252525

25262526
assert.same(stub(5), 1);
25272527
assert.same(stub(5), 2);
2528-
refute.defined(stub(5));
2528+
assert.isUndefined(stub(5));
25292529

25302530
stub.reset();
25312531

25322532
assert.same(stub(5), undefined);
25332533
assert.same(stub(5), undefined);
2534-
refute.defined(stub(5));
2534+
assert.isUndefined(stub(5));
25352535
});
25362536

25372537
it("throws an understandable error when trying to use withArgs on behavior", function() {
@@ -2777,7 +2777,7 @@ describe("stub", function() {
27772777

27782778
stub.resetBehavior();
27792779

2780-
refute.defined(stub());
2780+
assert.isUndefined(stub());
27812781
});
27822782

27832783
it("cleans behavior of fakes returned by withArgs", function() {
@@ -2786,7 +2786,7 @@ describe("stub", function() {
27862786

27872787
stub.resetBehavior();
27882788

2789-
refute.defined(stub("lolz"));
2789+
assert.isUndefined(stub("lolz"));
27902790
});
27912791

27922792
it("does not clean parents' behavior when called on a fake returned by withArgs", function() {
@@ -2804,7 +2804,7 @@ describe("stub", function() {
28042804

28052805
stub.resetBehavior();
28062806

2807-
refute.defined(stub("defined"));
2807+
assert.isUndefined(stub("defined"));
28082808
});
28092809

28102810
it("cleans 'returnsThis' behavior", function() {
@@ -2814,7 +2814,7 @@ describe("stub", function() {
28142814

28152815
instance.stub.resetBehavior();
28162816

2817-
refute.defined(instance.stub());
2817+
assert.isUndefined(instance.stub());
28182818
});
28192819

28202820
it("cleans 'resolvesThis' behavior, so the stub does not resolve nor returns anything", function() {
@@ -2824,7 +2824,7 @@ describe("stub", function() {
28242824

28252825
instance.stub.resetBehavior();
28262826

2827-
refute.defined(instance.stub());
2827+
assert.isUndefined(instance.stub());
28282828
});
28292829

28302830
describe("does not touch properties that are reset by 'reset'", function() {
@@ -2850,10 +2850,10 @@ describe("stub", function() {
28502850
assert.equals(stub.returnValues.length, 3);
28512851
assert.equals(stub.exceptions.length, 3);
28522852
assert.equals(stub.thisValues.length, 3);
2853-
assert.defined(stub.firstCall);
2854-
assert.defined(stub.secondCall);
2855-
assert.defined(stub.thirdCall);
2856-
assert.defined(stub.lastCall);
2853+
refute.isUndefined(stub.firstCall);
2854+
refute.isUndefined(stub.secondCall);
2855+
refute.isUndefined(stub.thirdCall);
2856+
refute.isUndefined(stub.lastCall);
28572857
});
28582858

28592859
it("call order state", function() {

test/util/fake-timers-test.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -792,7 +792,7 @@ describe("fakeTimers.clock", function() {
792792
} else {
793793
describe("unsupported now", function() {
794794
it("is undefined", function() {
795-
refute.defined(this.clock.Date.now);
795+
assert.isUndefined(this.clock.Date.now);
796796
});
797797
});
798798
}
@@ -818,7 +818,7 @@ describe("fakeTimers.clock", function() {
818818
} else {
819819
describe("unsupported toSource", function() {
820820
it("is undefined", function() {
821-
refute.defined(this.clock.Date.toSource);
821+
assert.isUndefined(this.clock.Date.toSource);
822822
});
823823
});
824824
}
@@ -1047,7 +1047,7 @@ describe("fakeTimers.clock", function() {
10471047
this.global.Date.now = null;
10481048
this.clock = fakeTimers.useFakeTimers(0);
10491049

1050-
refute.defined(Date.now);
1050+
assert.isUndefined(Date.now);
10511051
});
10521052

10531053
it("mirrors custom Date properties", function() {
@@ -1192,7 +1192,7 @@ describe("fakeTimers.clock", function() {
11921192
clearTimeout: sinonStub.create()
11931193
};
11941194
this.clock = fakeTimers.useFakeTimers({ global: globalCtx });
1195-
refute.defined(this.clock.performance);
1195+
assert.isUndefined(this.clock.performance);
11961196
assert.same(this.clock._setTimeout, stub); // eslint-disable-line no-underscore-dangle
11971197
this.clock.restore();
11981198
});

0 commit comments

Comments
 (0)