-
Notifications
You must be signed in to change notification settings - Fork 94
Add additional info to test results for better output #85
Add additional info to test results for better output #85
Conversation
Thanks for your pull request. It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA). 📝 Please visit https://cla.developers.google.com/ to sign. Once you've signed, please reply here (e.g.
|
@googlebot I signed it! |
CLAs look good, thanks! |
Could you add some documentation about this, so that it's easier to find for others later what properties are provided. |
@dignifiedquire What is the best place for documentation here? |
@roadhump just add a section to the readme titled |
Merging this for now, if you find some time please make another pr with some docs |
Add additional info to test results for better output
Here is updated README #87 |
Any chances of releasing this as a new version @dignifiedquire ? @roadhump does your reporter work with diffs already? |
Release is out |
error.actual = window.Mocha.utils.stringify(error_.actual) | ||
error.expected = window.Mocha.utils.stringify(error_.expected) |
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.
This crash when actual
or expected
has a circular reference: mochajs/mocha#4910. For example, this happens when actual
is a DOM element rendered by React.
@roadhump what was the use case for this logic? It seems something that you could do on the side of your custom reporter. https://github.com/roadhump/karma-mocha-own-reporter/blob/933b12d5567ba27b94c3b1c9c61e49f6146c6863/index.js#L82
Hello, I've just created karma-mocha-own-reporter, plugin which allows to use Mocha reporters in Karma. But it seems there is no easy way to make pretty diff output for my plugin like in Mocha itself. Any reporter gets not enough information for such output, just a string of assertion error message.
So I suggest to extend data which your plugin passes to reporters with
assertionErrors
, array of objects similar to errors Mocha assertion libraries produce. It contains info about expected and actual test outcome. This information will help me (or any other developer) to create more rich reporters.