How to use the jest-cli/build/reporters/default_reporter.default function in jest-cli

To help you get started, we’ve selected a few jest-cli 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 OfficeDev / office-ui-fabric-react / scripts / jest / jest-reporter.js View on Github external
const DefaultReporter = require('jest-cli/build/reporters/default_reporter').default;

 * The purpose of this custom reporter is to prevent Jest from logging to stderr
 * when there are no errors.
class JestReporter extends DefaultReporter {
  constructor(...args) {

    this._isLoggingError = false;
    this.log = message => {
      if (this._isLoggingError) {
        process.stderr.write(message + '\n');
      } else {
        process.stdout.write(message + '\n');