How to use the jest-matcher-utils.printReceived function in jest-matcher-utils

To help you get started, we’ve selected a few jest-matcher-utils examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github ArkEcosystem / core / tests / support / setup-framework.js View on Github external
? () =>
        matcherHint('.not.toBeType', 'value', 'type') +
        '\n\n' +
        'Expected value to be of type:\n' +
        `  ${printExpected(expected)}\n` +
        'Received:\n' +
        `  ${printReceived(received)}\n`
      : () =>
github ArkEcosystem / core / tests / support / setup-framework.js View on Github external
: () =>
        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)}`
github jest-community / jest-extended / src / matchers / toBeObject / index.js View on Github external
const failMessage = received => () =>
  matcherHint('.toBeObject', 'received', '') +
  '\n\n' +
  'Expected value to be an object, received:\n' +
  `  ${printReceived(received)}`;
github uber / baseweb / e2e / helpers / index.js View on Github external
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')}`;
github lerna / lerna / helpers / figgy-pudding-matchers / index.js View on Github external
message: () =>
      `${matcherHint(".toBeFiggyPudding", "received", "", {
        isNot: this.isNot,
      })}\n\nReceived: ${printReceived(received)}`,
  };
github jest-community / jest-extended / src / matchers / toBeFinite / index.js View on Github external
const passMessage = received => () =>
  matcherHint('.not.toBeFinite', 'received', '') +
  '\n\n' +
  'Expected value to not be finite received:\n' +
  `  ${printReceived(received)}`;
github jest-community / jest-extended / src / matchers / toBeNegative / index.js View on Github external
const passMessage = received => () =>
  matcherHint('.not.toBeNegative', 'received', '') +
  '\n\n' +
  'Expected value to not be a negative number received:\n' +
  `  ${printReceived(received)}`;
github jest-community / jest-extended / src / matchers / toBeExtensible / index.js View on Github external
const failMessage = received => () => {
  return (
    matcherHint('.toBeExtensible', 'received', '') +
    '\n\n' +
    'Expected value to be extensible received:\n' +
    `  ${printReceived(received)}`
  );
};
github lerna / lerna / helpers / figgy-pudding-matchers / index.js View on Github external
: () => {
        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}` : ""}`
        );
      };