bump jest and make tests pass

This commit is contained in:
Louis Hache committed 2020-11-13 19:11:55 +01:00
1 parent d28dc26fa3
commit 4f58d166b7
5769 files changed
+856618 -394571

No files matched your search

+15 -8
View File
@@ -5,10 +5,10 @@ Object.defineProperty(exports, '__esModule', {
});
exports.default = void 0;
var _jestMatcherUtils = require('jest-matcher-utils');
var _chalk = _interopRequireDefault(require('chalk'));
var _jestMatcherUtils = require('jest-matcher-utils');
function _interopRequireDefault(obj) {
return obj && obj.__esModule ? obj : {default: obj};
}
@@ -47,6 +47,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 '';
@@ -91,12 +95,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);
@@ -129,6 +128,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)}`) +