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
Use the original failure when ErrorCollector contains single failure #3269
Conversation
import io.kotest.matchers.should | ||
import io.kotest.matchers.shouldBe | ||
|
||
class ErrorCollectorTests : FreeSpec( |
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.
ah right there's no module for jsTest..
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.
Not sure what you meant with this 🤪 Did you mean that we should add a jsTest
to check that I didn't break the js/desktop error collector?
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.
Tested on my local machine and it seems to work fine. Made a comment for minor readability improvement.
actual fun ErrorCollector.collectiveError(): AssertionError? { | ||
val failures = errors() | ||
clear() | ||
return if (failures.isNotEmpty()) { |
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.
Could this be written cleaner as a when or else if statement instead of nested if?
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.
It could, yeah.. I'll do that.
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.
Done :)
ad8ae74
to
7806e5b
Compare
fixes #3236
AssertionFailedError
is JVM-specific, so had to move some stuff to expect/actuals.