Prevent jest from logging regular output to stderr

@ecraig12345 2019-02-21 01:14:42发表于 microsoft/just Package: just-stack-*

By default, for some reason jest logs its regular output to stderr rather than stdout. This confuses rush build and causes it to report that the projects in just "succeeded with warnings." Fabric works around this with a custom reporter. We should add a similar reporter for use within the just project and possibly also within the templates.

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 {
  log(message) {
    process.stdout.write(message + '\n');
  }
}

module.exports = JestReporter;