Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork3k
Description
Prerequisites
- Checked that your issue isn't already filed by cross referencingissues with the
common mistake
label - Checked next-gen ES issues and syntax problems by using the same environment and/or transpiler configuration without Mocha to ensure it isn't just a feature that actually isn't supported in the environment in question or a bug in your code.
- 'Smoke tested' the code to be tested by running it outside the real test suite to get a better sense of whether the problem is in the code under test, your usage of Mocha, or Mocha itself
- Ensured that there is no discrepancy between the locally and globally installed versions of Mocha. You can find them with:
node node_modules/.bin/mocha --version
(Local) andmocha --version
(Global). We recommend avoiding the use of globally installed Mocha.
Description
Mocha prints nice diffs for failed assertions. It'd be great to show these diffs when running mocha tests in IDE.
Currently, IDE accesseserr
object directly to format error info:https://github.com/JetBrains/mocha-intellij/blob/3c40655fcb8e4b216586d19ab83cac8c3f98e4a9/lib/mochaIntellijReporter.js#L157-L176 and doesn't print diffs in console (only clicking "Click to see difference" opens a separate diff dialog).
What do you think about allowing IDE to show unified diffs for failed assertions? // cc@boneskull
A possible API might look this:
// lib/utils.jsexports.prettifyError=function(err){return{msg:'<colored text with unified diff>',stack:'<colored tail of stack>'};};
In this case, bothlist
function fromlib/reporters/base.js
and IDE may useprettifyError
.
Original issue in WebStorm's tracker:https://youtrack.jetbrains.com/issue/WEB-28905