DEV: Improve `ember test` (testem) output (#16401)
- Repeat failure output at end (similar to rspec) - When running in GitHub actions, set a workflow error message
This commit is contained in:
parent
8e809149d2
commit
ef2e4f7ee0
|
@ -6,6 +6,8 @@ class Reporter {
|
||||||
this._tapReporter = new TapReporter(...arguments);
|
this._tapReporter = new TapReporter(...arguments);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
failReports = [];
|
||||||
|
|
||||||
reportMetadata(tag, metadata) {
|
reportMetadata(tag, metadata) {
|
||||||
if (tag === "summary-line") {
|
if (tag === "summary-line") {
|
||||||
process.stdout.write(`\n${metadata.message}\n`);
|
process.stdout.write(`\n${metadata.message}\n`);
|
||||||
|
@ -15,11 +17,24 @@ class Reporter {
|
||||||
}
|
}
|
||||||
|
|
||||||
report(prefix, data) {
|
report(prefix, data) {
|
||||||
|
if (data.failed) {
|
||||||
|
this.failReports.push([prefix, data]);
|
||||||
|
}
|
||||||
this._tapReporter.report(prefix, data);
|
this._tapReporter.report(prefix, data);
|
||||||
}
|
}
|
||||||
|
|
||||||
finish() {
|
finish() {
|
||||||
this._tapReporter.finish();
|
this._tapReporter.finish();
|
||||||
|
|
||||||
|
if (this.failReports.length > 0) {
|
||||||
|
process.stdout.write("\nFailures:\n\n");
|
||||||
|
this.failReports.forEach(([prefix, data]) => {
|
||||||
|
if (process.env.GITHUB_ACTIONS) {
|
||||||
|
process.stdout.write(`::error ::QUnit Test Failure: ${data.name}\n`);
|
||||||
|
}
|
||||||
|
this.report(prefix, data);
|
||||||
|
});
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue