Updating NPM dependencies

This commit is contained in:
Drew Heavner
2020-11-11 13:30:52 +00:00
committed by GitHub
parent 7a6fb66c63
commit bd487ef324
9068 changed files with 1400893 additions and 587661 deletions

View File

@@ -7,59 +7,22 @@ exports.default = void 0;
var _assert = require('assert');
var _jestMatcherUtils = require('jest-matcher-utils');
var _chalk = _interopRequireDefault(require('chalk'));
var _jestMatcherUtils = require('jest-matcher-utils');
var _prettyFormat = _interopRequireDefault(require('pretty-format'));
function _interopRequireDefault(obj) {
return obj && obj.__esModule ? obj : {default: obj};
}
var Symbol = global['jest-symbol-do-not-touch'] || global.Symbol;
function _slicedToArray(arr, i) {
return (
_arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _nonIterableRest()
);
}
function _nonIterableRest() {
throw new TypeError('Invalid attempt to destructure non-iterable instance');
}
function _iterableToArrayLimit(arr, i) {
var _arr = [];
var _n = true;
var _d = false;
var _e = undefined;
try {
for (
var _i = arr[Symbol.iterator](), _s;
!(_n = (_s = _i.next()).done);
_n = true
) {
_arr.push(_s.value);
if (i && _arr.length === i) break;
}
} catch (err) {
_d = true;
_e = err;
} finally {
try {
if (!_n && _i['return'] != null) _i['return']();
} finally {
if (_d) throw _e;
}
}
return _arr;
}
function _arrayWithHoles(arr) {
if (Array.isArray(arr)) return arr;
}
/**
* Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/
const assertOperatorsMap = {
'!=': 'notEqual',
'!==': 'notStrictEqual',
@@ -78,41 +41,37 @@ const humanReadableOperators = {
};
const formatNodeAssertErrors = (event, state) => {
switch (event.name) {
case 'test_done': {
event.test.errors = event.test.errors.map(errors => {
let error;
if (event.name === 'test_done') {
event.test.errors = event.test.errors.map(errors => {
let error;
if (Array.isArray(errors)) {
const _errors = _slicedToArray(errors, 2),
originalError = _errors[0],
asyncError = _errors[1];
if (Array.isArray(errors)) {
const [originalError, asyncError] = errors;
if (originalError == null) {
error = asyncError;
} else if (!originalError.stack) {
error = asyncError;
error.message = originalError.message
? originalError.message
: `thrown: ${(0, _prettyFormat.default)(originalError, {
maxDepth: 3
})}`;
} else {
error = originalError;
}
if (originalError == null) {
error = asyncError;
} else if (!originalError.stack) {
error = asyncError;
error.message = originalError.message
? originalError.message
: `thrown: ${(0, _prettyFormat.default)(originalError, {
maxDepth: 3
})}`;
} else {
error = errors;
error = originalError;
}
} else {
error = errors;
}
return isAssertionError(error)
? {
message: assertionErrorMessage(error, {
expand: state.expand
})
}
: errors;
});
}
return isAssertionError(error)
? {
message: assertionErrorMessage(error, {
expand: state.expand
})
}
: errors;
});
}
};
@@ -127,6 +86,10 @@ const getOperatorName = (operator, stack) => {
if (stack.match('.throws')) {
return 'throws';
} // this fallback is only needed for versions older than node 10
if (stack.match('.fail')) {
return 'fail';
}
return '';
@@ -171,12 +134,7 @@ const assertMatcherHint = (operator, operatorName, expected) => {
};
function assertionErrorMessage(error, options) {
const expected = error.expected,
actual = error.actual,
generatedMessage = error.generatedMessage,
message = error.message,
operator = error.operator,
stack = error.stack;
const {expected, actual, generatedMessage, message, operator, stack} = error;
const diffString = (0, _jestMatcherUtils.diff)(expected, actual, options);
const hasCustomMessage = !generatedMessage;
const operatorName = getOperatorName(operator, stack);
@@ -209,6 +167,14 @@ function assertionErrorMessage(error, options) {
);
}
if (operatorName === 'fail') {
return (
buildHintString(assertMatcherHint(operator, operatorName, expected)) +
_chalk.default.reset(hasCustomMessage ? 'Message:\n ' + message : '') +
trimmedStack
);
}
return (
buildHintString(assertMatcherHint(operator, operatorName, expected)) +
_chalk.default.reset(`Expected value ${operatorMessage(operator)}`) +