Update checked-in dependencies

This commit is contained in:
github-actions[bot] 2025-03-24 21:18:42 +00:00
parent 08e5c8d618
commit 5275714183
148 changed files with 4045 additions and 39247 deletions

2
node_modules/sinon/README.md generated vendored
View file

@ -55,7 +55,7 @@ If you have questions that are not covered by the documentation, you can [check
- Require minimal “integration”
- Easy to embed seamlessly with any testing framework
- Easily fake any interface
- Ship with ready-to-use fakes for XMLHttpRequest, timers and more
- Ship with ready-to-use fakes for timers
## Contribute?

View file

@ -7,18 +7,11 @@ const fakeTimers = require("./sinon/util/fake-timers");
const Sandbox = require("./sinon/sandbox");
const stub = require("./sinon/stub");
const promise = require("./sinon/promise");
const nise = require("nise");
const assert = require("assert");
/**
* @param {object} opts injection point to override the default XHR lib in testing
* @param {object} opts.sinonXhrLib
* @returns {object} a configured sandbox
*/
module.exports = function createApi(opts = { sinonXhrLib: nise }) {
assert(opts?.sinonXhrLib, "No XHR lib passed in");
const { sinonXhrLib } = opts;
module.exports = function createApi() {
const apiMethods = {
createSandbox: createSandbox,
match: require("@sinonjs/samsam").createMatcher,
@ -29,20 +22,6 @@ module.exports = function createApi(opts = { sinonXhrLib: nise }) {
// fake timers
timers: fakeTimers.timers,
// fake XHR
xhr: sinonXhrLib.fakeXhr.xhr,
FakeXMLHttpRequest: sinonXhrLib.fakeXhr.FakeXMLHttpRequest,
// 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);
},

View file

@ -9,14 +9,6 @@ const push = arrayProto.push;
function prepareSandboxFromConfig(config) {
const sandbox = new Sandbox({ assertOptions: config.assertOptions });
if (config.useFakeServer) {
if (typeof config.useFakeServer === "object") {
sandbox.serverPrototype = config.useFakeServer;
}
sandbox.useFakeServer();
}
if (config.useFakeTimers) {
if (typeof config.useFakeTimers === "object") {
sandbox.useFakeTimers(config.useFakeTimers);
@ -52,7 +44,6 @@ function exposeValue(sandbox, config, key, value) {
* @property {string[]} properties The properties of the API to expose on the sandbox. Examples: ['spy', 'fake', 'restore']
* @property {object} injectInto an object in which to inject properties from the sandbox (a facade). This is mostly an integration feature (sinon-test being one).
* @property {boolean} useFakeTimers whether timers are faked by default
* @property {boolean|object} useFakeServer whether XHR's are faked and the server feature enabled by default. It could also be a different default fake server implementation to use
* @property {object} [assertOptions] see CreateAssertOptions in ./assert
*
* This type def is really suffering from JSDoc not having standardized

View file

@ -90,10 +90,6 @@ const defaultBehaviors = {
fake.callsThrough = false;
},
usingPromise: function usingPromise(fake, promiseLibrary) {
fake.promiseLibrary = promiseLibrary;
},
yields: function (fake) {
fake.callArgAt = useLeftMostCallback;
fake.callbackArguments = slice(arguments, 1);

22
node_modules/sinon/lib/sinon/fake.js generated vendored
View file

@ -5,7 +5,6 @@ const createProxy = require("./proxy");
const nextTick = require("./util/core/next-tick");
const slice = arrayProto.slice;
let promiseLib = Promise;
module.exports = fake;
@ -119,7 +118,7 @@ fake.throws = function throws(value) {
fake.resolves = function resolves(value) {
// eslint-disable-next-line jsdoc/require-jsdoc
function f() {
return promiseLib.resolve(value);
return Promise.resolve(value);
}
return wrapFunc(f);
@ -147,29 +146,12 @@ fake.resolves = function resolves(value) {
fake.rejects = function rejects(value) {
// eslint-disable-next-line jsdoc/require-jsdoc
function f() {
return promiseLib.reject(getError(value));
return Promise.reject(getError(value));
}
return wrapFunc(f);
};
/**
* Causes `fake` to use a custom Promise implementation, instead of the native
* Promise implementation.
*
* @example
* const bluebird = require("bluebird");
* sinon.fake.usingPromise(bluebird);
*
* @memberof fake
* @param {*} promiseLibrary
* @returns {Function}
*/
fake.usingPromise = function usingPromise(promiseLibrary) {
promiseLib = promiseLibrary;
return fake;
};
/**
* Returns a `fake` that calls the callback with the defined arguments.
*

View file

@ -6,7 +6,6 @@ const proxyCallToString = require("./proxy-call").toString;
const extend = require("./util/core/extend");
const deepEqual = require("@sinonjs/samsam").deepEqual;
const wrapMethod = require("./util/core/wrap-method");
const usePromiseLibrary = require("./util/core/use-promise-library");
const concat = arrayProto.concat;
const filter = arrayProto.filter;
@ -78,7 +77,6 @@ extend(mock, {
const expectation = mockExpectation.create(method);
expectation.wrappedMethod = this.object[method].wrappedMethod;
push(this.expectations[method], expectation);
usePromiseLibrary(this.promiseLibrary, expectation);
return expectation;
},
@ -119,12 +117,6 @@ extend(mock, {
return true;
},
usingPromise: function usingPromise(promiseLibrary) {
this.promiseLibrary = promiseLibrary;
return this;
},
invokeMethod: function invokeMethod(method, thisValue, args) {
/* if we cannot find any matching files we will explicitly call mockExpection#fail with error messages */
/* eslint consistent-return: "off" */

View file

@ -14,9 +14,6 @@ const sinonStub = require("./stub");
const sinonCreateStubInstance = require("./create-stub-instance");
const sinonFake = require("./fake");
const valueToString = require("@sinonjs/commons").valueToString;
const fakeServer = require("nise").fakeServer;
const fakeXhr = require("nise").fakeXhr;
const usePromiseLibrary = require("./util/core/use-promise-library");
const DEFAULT_LEAK_THRESHOLD = 10000;
@ -80,7 +77,6 @@ function Sandbox(opts = {}) {
const sandbox = this;
const assertOptions = opts.assertOptions || {};
let fakeRestorers = [];
let promiseLib;
let collection = [];
let loggedLeakWarning = false;
@ -101,8 +97,6 @@ function Sandbox(opts = {}) {
sandbox.assert = sinonAssert.createAssertObject(assertOptions);
sandbox.serverPrototype = fakeServer;
// this is for testing only
sandbox.getFakes = function getFakes() {
return collection;
@ -117,8 +111,6 @@ function Sandbox(opts = {}) {
addToCollection(method);
});
usePromiseLibrary(promiseLib, ownMethods);
return stubbed;
};
@ -163,11 +155,6 @@ function Sandbox(opts = {}) {
obj.clock = sandbox.clock;
}
if (sandbox.server) {
obj.server = sandbox.server;
obj.requests = sandbox.server.requests;
}
obj.match = match;
return obj;
@ -177,7 +164,6 @@ function Sandbox(opts = {}) {
const m = sinonMock.apply(null, arguments);
addToCollection(m);
usePromiseLibrary(promiseLib, m);
return m;
};
@ -430,16 +416,12 @@ function Sandbox(opts = {}) {
forEach(ownMethods, function (method) {
addToCollection(method);
});
usePromiseLibrary(promiseLib, ownMethods);
} else if (Array.isArray(types)) {
for (const accessorType of types) {
addToCollection(spy[accessorType]);
usePromiseLibrary(promiseLib, spy[accessorType]);
}
} else {
addToCollection(spy);
usePromiseLibrary(promiseLib, spy);
}
return spy;
@ -505,32 +487,6 @@ function Sandbox(opts = {}) {
throw exception;
}
};
sandbox.useFakeServer = function useFakeServer() {
const proto = sandbox.serverPrototype || fakeServer;
if (!proto || !proto.create) {
return null;
}
sandbox.server = proto.create();
addToCollection(sandbox.server);
return sandbox.server;
};
sandbox.useFakeXMLHttpRequest = function useFakeXMLHttpRequest() {
const xhr = fakeXhr.useFakeXMLHttpRequest();
addToCollection(xhr);
return xhr;
};
sandbox.usingPromise = function usingPromise(promiseLibrary) {
promiseLib = promiseLibrary;
collection.promiseLibrary = promiseLibrary;
return sandbox;
};
}
Sandbox.prototype.match = match;

View file

@ -1,21 +0,0 @@
"use strict";
const forEach = Array.prototype.forEach;
function usePromiseLibrary(library, fakes) {
if (typeof library === "undefined") {
return;
}
if (Array.isArray(fakes)) {
forEach.call(fakes, usePromiseLibrary.bind(null, library));
return;
}
if (typeof fakes.usingPromise === "function") {
fakes.usingPromise(library);
}
}
module.exports = usePromiseLibrary;

9
node_modules/sinon/package.json generated vendored
View file

@ -15,7 +15,7 @@
"xhr",
"assert"
],
"version": "19.0.2",
"version": "20.0.0",
"homepage": "https://sinonjs.org/",
"author": "Christian Johansen",
"repository": {
@ -48,7 +48,6 @@
"build-docs": "cd docs; make build",
"serve-docs": "cd docs; make livereload",
"lint": "eslint --max-warnings 0 '**/*.{js,cjs,mjs}'",
"unimported": "unimported .",
"pretest-webworker": "npm run build",
"prebuild": "rimraf pkg && npm run check-dependencies && npm run update-compatibility",
"postbuild": "npm run test-esm-support && npm run test-esm-browser-build",
@ -81,10 +80,9 @@
},
"dependencies": {
"@sinonjs/commons": "^3.0.1",
"@sinonjs/fake-timers": "^13.0.2",
"@sinonjs/fake-timers": "^13.0.5",
"@sinonjs/samsam": "^8.0.1",
"diff": "^7.0.0",
"nise": "^6.1.1",
"supports-color": "^7.2.0"
},
"devDependencies": {
@ -111,8 +109,7 @@
"puppeteer": "^23.3.0",
"rimraf": "^6.0.1",
"semver": "^7.6.3",
"shelljs": "^0.8.5",
"unimported": "^1.31.1"
"shelljs": "^0.8.5"
},
"files": [
"lib",

7434
node_modules/sinon/pkg/sinon-esm.js generated vendored

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

7416
node_modules/sinon/pkg/sinon.js generated vendored

File diff suppressed because one or more lines are too long