Mutation testing Real time
A NodeJS helper package to help with the server side of real-time reporting.
Usage example
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);
}
});
reporter.sendMutantTested({ id: '1', status: 'Killed' });
reporter.sendFinished();
API Reference
RealTimeReporter
RealTimeReporter.prototype.sendMutantTested
[(Partial<MutationTestResult>) => void
]
RealTimeReporter.prototype.sendFinished
[() => void
]
Event: 'client-connected'
client: MutationEventSender
Emitted each time a client connects to this real time reporter.
Event: 'client-disconnected'
client: MutationEventSender
Emitted each time a client disconnects from this real time reporter.