Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

🚀 Feature: Expose public API for accessing diffs #3011

Closed
Deckhandfirststar01/mocha
#13
Labels
@segrey

Description

@segrey

Prerequisites

  • Checked that your issue isn't already filed by cross referencingissues with thecommon 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

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions


      [8]ページ先頭

      ©2009-2025 Movatter.jp