A NodeJS helper package to help with the server side of real-time reporting.
import { createServer } from 'http';
import { RealTimeReporter } from 'mutation-testing-real-time';
const reporter = new RealTimeReporter({ accessControlAllowOrigin: '*' });
const server = new createServer((req, res) => {
if (req.url === '/sse') {
reporter.add(res);
}
});
// Whenever a mutant result comes in:
reporter.sendMutantTested({ id: '1', status: 'Killed' });
// ...
// Whenever we are done:
reporter.sendFinished();
client: MutationEventSender
Emitted each time a client connects to this real time reporter.
client: MutationEventSender
Emitted each time a client disconnects from this real time reporter.