Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
? () =>
matcherHint('.not.toBeType', 'value', 'type') +
'\n\n' +
'Expected value to be of type:\n' +
` ${printExpected(expected)}\n` +
'Received:\n' +
` ${printReceived(received)}\n`
: () =>
: () =>
matcherHint('.toBeType', 'value', 'type') +
'\n\n' +
'Expected value to be of type:\n' +
` ${printExpected(expected)}\n` +
'Received:\n' +
` ${printReceived(received)}\n` +
'type:\n' +
` ${printReceived(type)}`
const failMessage = received => () =>
matcherHint('.toBeObject', 'received', '') +
'\n\n' +
'Expected value to be an object, received:\n' +
` ${printReceived(received)}`;
const printInvalidRule = rule =>
`Violated rule: ${printReceived(rule.id)}\nReasoning: ${printReceived(
rule.help,
)}\n${rule.nodes.length} nodes involved:\n\n${rule.nodes
.map(printInvalidNode)
.join('\n')}`;
message: () =>
`${matcherHint(".toBeFiggyPudding", "received", "", {
isNot: this.isNot,
})}\n\nReceived: ${printReceived(received)}`,
};
const passMessage = received => () =>
matcherHint('.not.toBeFinite', 'received', '') +
'\n\n' +
'Expected value to not be finite received:\n' +
` ${printReceived(received)}`;
const passMessage = received => () =>
matcherHint('.not.toBeNegative', 'received', '') +
'\n\n' +
'Expected value to not be a negative number received:\n' +
` ${printReceived(received)}`;
const failMessage = received => () => {
return (
matcherHint('.toBeExtensible', 'received', '') +
'\n\n' +
'Expected value to be extensible received:\n' +
` ${printReceived(received)}`
);
};
: () => {
const figgyObj = received.toJSON();
const diffString = diff(expected, figgyObj, {
expand: this.expand,
});
return (
`${matcherHint(".figgyPudding", undefined, undefined, {
isDirectExpectCall: true,
})}\n\n` +
`Expected pudding to contain:\n` +
` ${printExpected(expected)}\n` +
`Received:\n` +
` ${printReceived(figgyObj)}${diffString ? `\n\nDifference:\n\n${diffString}` : ""}`
);
};