-
Notifications
You must be signed in to change notification settings - Fork 5.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix(runtime/testing): format aggregate errors #12183
fix(runtime/testing): format aggregate errors #12183
Conversation
runtime/js/40_testing.js
Outdated
@@ -186,6 +186,14 @@ finishing test case.`; | |||
ArrayPrototypePush(tests, testDef); | |||
} | |||
|
|||
function formatFailure(error) { | |||
if (error.errors) { | |||
return { failed: error.errors.map(error => inspectArgs([error])).join("\n") }; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Blank line in-between?
return { failed: error.errors.map(error => inspectArgs([error])).join("\n") }; | |
return { failed: error.errors.map(error => inspectArgs([error])).join("\n\n") }; |
b5c5cbf
to
a243343
Compare
How about this formatting:
|
Looked at Sindre's implementation, seemed like a reasonable way to format it. Pretty much the same as your suggestion @nayeemrmn but there's no delimiters, 4 spaces is quite obvious with a monospace font in a terminal tho.
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Seems useful. @dsherret any objections?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks nice!
Prints out the actual errors contained in aggregate errors rather than just stating that an aggregate error occured.
Before:
After: