Update checked-in dependencies

This commit is contained in:
github-actions[bot] 2022-01-29 01:49:46 +00:00
parent 9673b562d9
commit 6410c0691e
28 changed files with 8738 additions and 3194 deletions

BIN
node_modules/sinon/lib/.DS_Store generated vendored

Binary file not shown.

3
node_modules/sinon/lib/package.json generated vendored Normal file
View file

@ -0,0 +1,3 @@
{
"type": "commonjs"
}

View file

@ -159,10 +159,16 @@ function createAssertObject() {
callCount: function assertCallCount(method, count) {
verifyIsStub(method);
if (method.callCount !== count) {
var msg = `expected %n to be called ${timesInWords(
count
)} but was called %c%C`;
var msg;
if (typeof count !== "number") {
msg =
`expected ${format(count)} to be a number ` +
`but was of type ${typeof count}`;
failAssertion(this, msg);
} else if (method.callCount !== count) {
msg =
`expected %n to be called ${timesInWords(count)} ` +
`but was called %c%C`;
failAssertion(this, method.printf(msg));
} else {
assert.pass("callCount");

View file

@ -8,7 +8,7 @@ var STATUS_RESOLVED = "resolved";
var STATUS_REJECTED = "rejected";
/**
* Returns a fake for a given function or undefined. If no functino is given, a
* Returns a fake for a given function or undefined. If no function is given, a
* new fake is returned. If the given function is already a fake, it is
* returned as is. Otherwise the given function is wrapped in a new fake.
*

View file

@ -220,7 +220,8 @@ var callProto = {
}
}
if (this.stack) {
// Omit the error message and the two top stack frames in sinon itself:
// If we have a stack, add the first frame that's in end-user code
// Skip the first two frames because they will refer to Sinon code
callStr += (this.stack.split("\n")[3] || "unknown").replace(
/^\s*(?:at\s+|@)?/,
" at "

View file

@ -120,16 +120,16 @@ var proxyApi = {
var args = slice(arguments, 1);
var formatter;
return (format || "").replace(/%(.)/g, function (match, specifyer) {
formatter = proxyApi.formatters[specifyer];
return (format || "").replace(/%(.)/g, function (match, specifier) {
formatter = proxyApi.formatters[specifier];
if (typeof formatter === "function") {
return String(formatter(spyInstance, args));
} else if (!isNaN(parseInt(specifyer, 10))) {
return sinonFormat(args[specifyer - 1]);
} else if (!isNaN(parseInt(specifier, 10))) {
return sinonFormat(args[specifier - 1]);
}
return `%${specifyer}`;
return `%${specifier}`;
});
},

View file

@ -72,29 +72,29 @@ module.exports = {
j < calledArgs.length || j < expectedArgs.length;
++j
) {
if (calledArgs[j]) {
calledArgs[j] = quoteStringValue(calledArgs[j]);
var calledArg = calledArgs[j];
var expectedArg = expectedArgs[j];
if (calledArg) {
calledArg = quoteStringValue(calledArg);
}
if (expectedArgs[j]) {
expectedArgs[j] = quoteStringValue(expectedArgs[j]);
if (expectedArg) {
expectedArg = quoteStringValue(expectedArg);
}
message += "\n";
var calledArgMessage =
j < calledArgs.length ? sinonFormat(calledArgs[j]) : "";
if (match.isMatcher(expectedArgs[j])) {
j < calledArgs.length ? sinonFormat(calledArg) : "";
if (match.isMatcher(expectedArg)) {
message += colorSinonMatchText(
expectedArgs[j],
calledArgs[j],
expectedArg,
calledArg,
calledArgMessage
);
} else {
var expectedArgMessage =
j < expectedArgs.length
? sinonFormat(expectedArgs[j])
: "";
j < expectedArgs.length ? sinonFormat(expectedArg) : "";
var diff = jsDiff.diffJson(
calledArgMessage,
expectedArgMessage

33
node_modules/sinon/lib/sinon/stub.js generated vendored
View file

@ -81,6 +81,9 @@ function stub(object, property) {
}
var actualDescriptor = getPropertyDescriptor(object, property);
assertValidPropertyDescriptor(actualDescriptor, property);
var isObjectOrFunction =
typeof object === "object" || typeof object === "function";
var isStubbingEntireObject =
@ -147,6 +150,36 @@ stub.createStubInstance = function (constructor, overrides) {
return stubbedObject;
};
function assertValidPropertyDescriptor(descriptor, property) {
if (!descriptor || !property) {
return;
}
if (!descriptor.configurable && !descriptor.writable) {
throw new TypeError(
`Descriptor for property ${property} is non-configurable and non-writable`
);
}
if ((descriptor.get || descriptor.set) && !descriptor.configurable) {
throw new TypeError(
`Descriptor for accessor property ${property} is non-configurable`
);
}
if (isDataDescriptor(descriptor) && !descriptor.writable) {
throw new TypeError(
`Descriptor for data property ${property} is non-writable`
);
}
}
function isDataDescriptor(descriptor) {
return (
!descriptor.value &&
!descriptor.writable &&
!descriptor.set &&
!descriptor.get
);
}
/*eslint-disable no-use-before-define*/
function getParentBehaviour(stubInstance) {
return stubInstance.parent && getCurrentBehavior(stubInstance.parent);

Binary file not shown.

Binary file not shown.

View file

@ -108,7 +108,7 @@ module.exports = function extend(target, ...sources) {
};
/*
if the sorce has an Accessor property copy over the accessor functions (get and set)
data properties has writable attribute where as acessor property don't
data properties has writable attribute where as accessor property don't
REF: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures#properties
*/