Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
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);
};
}