2024-06-06 14:40:35 +02:00
|
|
|
/**
|
|
|
|
* @file Custom mocha reporter.
|
|
|
|
*
|
|
|
|
* Serves to clear the console after the test run is finished.
|
2024-09-29 16:28:34 +02:00
|
|
|
* See {@link https://github.com/mochajs/mocha/issues/2312}.
|
2024-06-06 14:40:35 +02:00
|
|
|
*/
|
|
|
|
|
2024-03-24 19:38:18 +02:00
|
|
|
const {reporters, Runner} = require('mocha');
|
2022-01-19 19:23:32 +02:00
|
|
|
|
2024-03-24 19:38:18 +02:00
|
|
|
const {EVENT_RUN_END} = Runner.constants;
|
2022-01-19 19:23:32 +02:00
|
|
|
|
|
|
|
class EvenMoreMin extends reporters.Base {
|
2024-06-06 14:40:35 +02:00
|
|
|
/**
|
2024-09-29 16:28:34 +02:00
|
|
|
* Construct a new `EvenMoreMin` reporter.
|
|
|
|
* @param {import('mocha').Runner} runner Mocha test runner.
|
2024-06-06 14:40:35 +02:00
|
|
|
*/
|
2022-01-19 19:23:32 +02:00
|
|
|
constructor(runner) {
|
|
|
|
super(runner);
|
2024-09-29 16:28:34 +02:00
|
|
|
runner.once(EVENT_RUN_END, () => {
|
|
|
|
// TODO: mocha's base reporters are not typed
|
|
|
|
// @ts-ignore
|
|
|
|
return this.epilogue();
|
|
|
|
});
|
2022-01-19 19:23:32 +02:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
module.exports = EvenMoreMin;
|