Update checked-in dependencies
This commit is contained in:
parent
79817eb679
commit
9c3b394d7f
402 changed files with 12598 additions and 2912 deletions
67
node_modules/sinon/lib/sinon.js
generated
vendored
67
node_modules/sinon/lib/sinon.js
generated
vendored
|
|
@ -9,40 +9,53 @@ const Sandbox = require("./sinon/sandbox");
|
|||
const stub = require("./sinon/stub");
|
||||
const promise = require("./sinon/promise");
|
||||
|
||||
const apiMethods = {
|
||||
createSandbox: createSandbox,
|
||||
assert: require("./sinon/assert"),
|
||||
match: require("@sinonjs/samsam").createMatcher,
|
||||
restoreObject: require("./sinon/restore-object"),
|
||||
/**
|
||||
* @param {object} opts injection point to override the default XHR lib in testing
|
||||
* @param {object} opts.sinonXhrLib
|
||||
* @returns {object} a configured sandbox
|
||||
*/
|
||||
function createApi({ sinonXhrLib }) {
|
||||
const apiMethods = {
|
||||
createSandbox: createSandbox,
|
||||
assert: require("./sinon/assert"),
|
||||
match: require("@sinonjs/samsam").createMatcher,
|
||||
restoreObject: require("./sinon/restore-object"),
|
||||
|
||||
expectation: require("./sinon/mock-expectation"),
|
||||
defaultConfig: require("./sinon/util/core/default-config"),
|
||||
expectation: require("./sinon/mock-expectation"),
|
||||
defaultConfig: require("./sinon/util/core/default-config"),
|
||||
|
||||
// fake timers
|
||||
timers: fakeTimers.timers,
|
||||
// fake timers
|
||||
timers: fakeTimers.timers,
|
||||
|
||||
// fake XHR
|
||||
xhr: nise.fakeXhr.xhr,
|
||||
FakeXMLHttpRequest: nise.fakeXhr.FakeXMLHttpRequest,
|
||||
// fake XHR
|
||||
xhr: sinonXhrLib.fakeXhr.xhr,
|
||||
FakeXMLHttpRequest: sinonXhrLib.fakeXhr.FakeXMLHttpRequest,
|
||||
|
||||
// fake server
|
||||
fakeServer: nise.fakeServer,
|
||||
fakeServerWithClock: nise.fakeServerWithClock,
|
||||
createFakeServer: nise.fakeServer.create.bind(nise.fakeServer),
|
||||
createFakeServerWithClock: nise.fakeServerWithClock.create.bind(
|
||||
nise.fakeServerWithClock
|
||||
),
|
||||
// fake server
|
||||
fakeServer: sinonXhrLib.fakeServer,
|
||||
fakeServerWithClock: sinonXhrLib.fakeServerWithClock,
|
||||
createFakeServer: sinonXhrLib.fakeServer.create.bind(
|
||||
sinonXhrLib.fakeServer,
|
||||
),
|
||||
createFakeServerWithClock: sinonXhrLib.fakeServerWithClock.create.bind(
|
||||
sinonXhrLib.fakeServerWithClock,
|
||||
),
|
||||
|
||||
addBehavior: function (name, fn) {
|
||||
behavior.addBehavior(stub, name, fn);
|
||||
},
|
||||
addBehavior: function (name, fn) {
|
||||
behavior.addBehavior(stub, name, fn);
|
||||
},
|
||||
|
||||
// fake promise
|
||||
promise: promise,
|
||||
};
|
||||
// fake promise
|
||||
promise: promise,
|
||||
};
|
||||
|
||||
const sandbox = new Sandbox();
|
||||
const sandbox = new Sandbox();
|
||||
return extend(sandbox, apiMethods);
|
||||
}
|
||||
|
||||
const api = extend(sandbox, apiMethods);
|
||||
const api = createApi({ sinonXhrLib: nise });
|
||||
|
||||
module.exports = api;
|
||||
|
||||
// solely exposed for easier testing
|
||||
module.exports.createApi = createApi;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue