How to use the jest-message-util.formatExecError function in jest-message-util

To help you get started, we’ve selected a few jest-message-util 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 facebook / jest / packages / jest-circus / src / index.ts View on Github external
console.log(
      formatExecError(
        new ErrorWithStack(
          chalk.yellow(
            'Returning a Promise from "describe" is not supported. Tests must be defined synchronously.\n' +
              'Returning a value from "describe" will fail the test in a future version of Jest.',
          ),
          describeFn,
        ),
        {rootDir: '', testMatch: []},
        {noStackTrace: false},
      ),
    );
  } else if (describeReturn !== undefined) {
    console.log(
      formatExecError(
        new ErrorWithStack(
          chalk.yellow(
            'A "describe" callback must not return a value.\n' +
              'Returning a value from "describe" will fail the test in a future version of Jest.',
          ),
          describeFn,
        ),
        {rootDir: '', testMatch: []},
        {noStackTrace: false},
      ),
    );
  }

  dispatch({blockName, mode, name: 'finish_describe_definition'});
};
github facebook-atom / jest-electron-runner / packages / core / src / utils.js View on Github external
export const buildFailureTestResult = (
  testPath: string,
  err: Error,
  config: ProjectConfig,
  globalConfig: GlobalConfig,
): TestResult => {
  const failureMessage = formatExecError(err, config, globalConfig);
  return {
    console: null,
    displayName: '',
    failureMessage,
    leaks: false,
    numFailingTests: 0,
    numPassingTests: 0,
    numPendingTests: 0,
    perfStats: {
      end: 0,
      start: 0,
    },
    skipped: false,
    snapshot: {
      added: 0,
      fileDeleted: false,
github facebookarchive / atom-ide-ui / modules / jest-atom-runner / src / utils.js View on Github external
export const buildFailureTestResult = (
  testPath: string,
  err: Error,
  config: ProjectConfig,
  globalConfig: GlobalConfig,
): TestResult => {
  const failureMessage = formatExecError(err, config, globalConfig);
  return {
    console: null,
    displayName: '',
    failureMessage,
    leaks: false,
    numFailingTests: 0,
    numPassingTests: 0,
    numPendingTests: 0,
    perfStats: {
      end: 0,
      start: 0,
    },
    skipped: false,
    snapshot: {
      added: 0,
      fileDeleted: false,