in src/reporters/build_kite_cli.ts [66:106]
override onEnd() {
const { failed, succeeded, skipped } = this.metrics;
const total = failed + succeeded + skipped;
if (total > 0) {
const failedJourneys = Array.from(this.journeys.entries()).filter(
([, steps]) => steps.some(step => step.status === 'failed')
);
// if more than 5 journeys, we also report failed journeys at the end
if (failedJourneys.length > 0 && this.journeys.size > 5) {
failedJourneys.forEach(([journeyName, steps]) => {
const name = red(`Journey: ${journeyName} :slightly_frowning_face:`);
this.write(`\n+++ ${name}`);
steps.forEach(step => {
const message = `${symbols[step.status]} Step: '${step.name}' ${
step.status
} (${renderDuration(step.duration * 1000)} ms)`;
this.write(indent(message));
if (step.error) {
this.write(renderError(serializeError(step.error)));
}
});
});
}
}
let message = '\n';
if (total === 0) {
message = 'No tests found!';
message += ` (${renderDuration(now())} ms) \n`;
this.write(message);
return;
}
message += succeeded > 0 ? green(` ${succeeded} passed`) : '';
message += failed > 0 ? red(` ${failed} failed`) : '';
message += skipped > 0 ? cyan(` ${skipped} skipped`) : '';
message += ` (${renderDuration(now() / 1000)} seconds) \n`;
this.write(message);
}