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

Lines changed: 2 additions & 4 deletions
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

Lines changed: 2 additions & 4 deletions
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

Lines changed: 2 additions & 4 deletions
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)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy