function JestJUnit (globalConfig, options) {
  // See if constructor was invoked statically
  // which indicates jest-junit was invoked as a testResultsProcessor
  // and show deprecation warning

  if (globalConfig.hasOwnProperty('testResults')) {
    const newConfig = JSON.stringify({
      reporters: ['jest-junit']
    }, null, 2);

    jestValidate.logValidationWarning('testResultsProcessor support is deprecated. Please use jest reporter. See https://github.com/jest-community/jest-junit#usage', newConfig);
    return processor(globalConfig);
  }

  this._globalConfig = globalConfig;
  this._options = options;

  this.onTestResult = (test, testResult, aggregatedResult) => {
    if (testResult.console && testResult.console.length > 0) {
      consoleBuffer[testResult.testFilePath] = testResult.console;
    }
  };

  this.onRunComplete = (contexts, results) => {
    processor(results, this._options, this._globalConfig.rootDir);
  };
}
// TODO: refactor to es6 class after testResultsProcessor support is removed
refactor to es6 class after testResultsProcessor support is removed
refactor to es6 class after testResultsProcessor support is removed
function JestJUnit (globalConfig, options) {
  if (globalConfig.hasOwnProperty('testResults')) {
    const newConfig = JSON.stringify({
      reporters: ['jest-junit']
    }, null, 2);
    jestValidate.logValidationWarning('testResultsProcessor support is deprecated. Please use jest reporter. See https://github.com/jest-community/jest-junit#usage', newConfig);
    return processor(globalConfig);
  }
  this._globalConfig = globalConfig;
  this._options = options;
  this.onTestResult = (test, testResult, aggregatedResult) => {
    if (testResult.console && testResult.console.length > 0) {
      consoleBuffer[testResult.testFilePath] = testResult.console;
    }
  };
  this.onRunComplete = (contexts, results) => {
    processor(results, this._options, this._globalConfig.rootDir);
  };
}
function JestJUnit ( globalConfig , options ) { if ( globalConfig . hasOwnProperty ( 'testResults' ) ) { const newConfig = JSON . stringify ( { reporters : [ 'jest-junit' ] } , null , 2 ) ; jestValidate . logValidationWarning ( 'testResultsProcessor support is deprecated. Please use jest reporter. See https://github.com/jest-community/jest-junit#usage' , newConfig ) ; return processor ( globalConfig ) ; } this . _globalConfig = globalConfig ; this . _options = options ; this . onTestResult = ( test , testResult , aggregatedResult ) => { if ( testResult . console && testResult . console . length > 0 ) { consoleBuffer [ testResult . testFilePath ] = testResult . console ; } } ; this . onRunComplete = ( contexts , results ) => { processor ( results , this . _options , this . _globalConfig . rootDir ) ; } ; }
TODO: refactor to es6 class after testResultsProcessor support is removed
TODO : refactor to es6 class after testResultsProcessor support is removed
// See if constructor was invoked statically // which indicates jest-junit was invoked as a testResultsProcessor // and show deprecation warning