Skip to content

Commit c618edc

Browse files
committed
fix #2594: remove needless sandbox creation
1 parent 16a25ae commit c618edc

File tree

3 files changed

+6
-12
lines changed

3 files changed

+6
-12
lines changed

docs/release-source/release/examples/spies-2-wrap-object-methods.test.js

+2-4
Original file line numberDiff line numberDiff line change
@@ -16,14 +16,12 @@ const myExternalLibrary = {
1616
};
1717

1818
describe("Wrap all object methods", function () {
19-
const sandbox = sinon.createSandbox();
20-
2119
beforeEach(function () {
22-
sandbox.spy(myExternalLibrary);
20+
sinon.spy(myExternalLibrary);
2321
});
2422

2523
afterEach(function () {
26-
sandbox.restore();
24+
sinon.restore();
2725
});
2826

2927
it("should inspect the external lib's usage of its internal methods", function () {

docs/release-source/release/examples/spies-3-wrap-existing-method.test.js

+2-4
Original file line numberDiff line numberDiff line change
@@ -11,14 +11,12 @@ const jQuery = require("jquery")(window);
1111
global.document = document;
1212

1313
describe("Wrap existing method", function () {
14-
const sandbox = sinon.createSandbox();
15-
1614
beforeEach(function () {
17-
sandbox.spy(jQuery, "ajax");
15+
sinon.spy(jQuery, "ajax");
1816
});
1917

2018
afterEach(function () {
21-
sandbox.restore();
19+
sinon.restore();
2220
});
2321

2422
it("should inspect jQuery.getJSON's usage of jQuery.ajax", function () {

docs/release-source/release/examples/spies-8-spy-call.test.js

+2-4
Original file line numberDiff line numberDiff line change
@@ -11,14 +11,12 @@ const jQuery = require("jquery")(window);
1111
global.document = document;
1212

1313
describe("Return nth call", function () {
14-
const sandbox = sinon.createSandbox();
15-
1614
beforeEach(function () {
17-
sandbox.spy(jQuery, "ajax");
15+
sinon.spy(jQuery, "ajax");
1816
});
1917

2018
afterEach(function () {
21-
sandbox.restore();
19+
sinon.restore();
2220
});
2321

2422
it("should inspect jQuery.getJSON's usage of jQuery.ajax", function () {

0 commit comments

Comments
 (0)