Skip to content

Commit e7c73af

Browse files
committed
fix(reporters): don't register on exit handler unless reporter is selected
1 parent e517df4 commit e7c73af

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

reporters/junit.js

+4-4
Original file line numberDiff line numberDiff line change
@@ -28,9 +28,9 @@ module.exports = async function junitReporter(err, results, opts, filenameForOut
2828
}
2929
}
3030
}
31+
process.on('exit', () => {
32+
writeFileSync('junit.xml', doc.end({ prettyPrint: true }) + '\n');
33+
console.error('\nWrote junit.xml');
34+
});
3135
};
3236

33-
process.on('exit', () => {
34-
writeFileSync('junit.xml', doc.end({ prettyPrint: true }) + '\n');
35-
console.error('\nWrote junit.xml');
36-
})

0 commit comments

Comments
 (0)