Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
files.forEach( reportPath => {
if ( ! reportPath.match( /xml$/i ) ) {
return;
}
try {
const xmlString = fs.readFileSync( `${ reportDir }/${ reportPath }`, 'utf-8' );
const xmlData = XunitViewerParser.parse( xmlString );
failuresCount += xmlData[ 0 ].tests.filter( t => t.status === 'fail' ).length;
} catch ( e ) {
console.log( `Error reading report file, likely just timing race: ${ e.message }` );
}
copyReports( slackClient, reportDir, reportPath, testRun.guid );
} );
files.forEach( reportPath => {
if ( ! reportPath.match( /xml$/i ) ) {
return;
}
try {
const xmlString = fs.readFileSync( `${ reportDir }/${ reportPath }`, 'utf-8' );
const xmlData = XunitViewerParser.parse( xmlString );
failuresCount += xmlData[ 0 ].tests.filter( t => t.status === 'fail' ).length;
} catch ( e ) {
console.log( `Error reading report file, likely just timing race: ${ e.message }` );
}
copyReports( slackClient, reportDir, reportPath, testRun.guid );
} );