Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
import chalk from 'chalk';
import * as utils from 'jest-matcher-utils';
utils.EXPECTED_COLOR; // $ExpectType Chalk
utils.RECEIVED_COLOR; // $ExpectType Chalk
utils.SUGGEST_TO_EQUAL; // $ExpectType string
utils.stringify({}); // $ExpectType string
utils.stringify({}, 44);
utils.stringify({}, '44'); // $ExpectError
utils.stringify({}, false); // $ExpectError
utils.highlightTrailingWhitespace('', chalk.red); // $ExpectType string
utils.highlightTrailingWhitespace(44, chalk.blue); // $ExpectError
utils.highlightTrailingWhitespace(false, chalk.green); // $ExpectError
utils.printReceived({}); // $ExpectType string
utils.printExpected({}); // $ExpectType string
utils.printWithType('obj', {}, () => ''); // $ExpectType string
utils.ensureNoExpected(null, ''); // $ExpectType void
utils.ensureNoExpected('', '');
const oneline = (0, _utils.isOneline)(expected, received);
const diffString = (0, _jestMatcherUtils.diff)(expected, received, {
expand: this.expand
});
return (
(0, _jestMatcherUtils.matcherHint)(
matcherName,
undefined,
undefined,
options
) +
'\n\n' +
`Expected: ${(0, _jestMatcherUtils.printExpected)(expected)}\n` +
`Received: ${(0, _jestMatcherUtils.printReceived)(received)}` +
(diffString && !oneline ? `\n\nDifference:\n\n${diffString}` : '') +
(suggestToEqual ? ` ${_jestMatcherUtils.SUGGEST_TO_EQUAL}` : '')
);
}; // Passing the actual and expected objects so that a custom reporter
// could access them, for example in order to display a custom visual diff,