Skip to content
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

Stacktraces don't filter mocha when minified #3921

Closed
4 tasks done
brian-lagerman opened this issue May 17, 2019 · 0 comments · Fixed by #3922
Closed
4 tasks done

Stacktraces don't filter mocha when minified #3921

brian-lagerman opened this issue May 17, 2019 · 0 comments · Fixed by #3922
Labels
area: browser browser-specific area: integrations related to working with 3rd party software (e.g., babel, typescript)

Comments

@brian-lagerman
Copy link
Contributor

Prerequisites

  • Checked that your issue hasn't already been filed by cross-referencing issues with the faq 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) and mocha --version(Global). We recommend that you not install Mocha globally.

Description

When running tests in the browser, the stackTraceFilter removes lines containing mocha.js as designed. This fails when using a minified version (from cdnjs) of mocha, as mocha.min.js is not tested for.

Steps to Reproduce

Swap
<script src="https://cdnjs.cloudflare.com/ajax/libs/mocha/6.1.4/mocha.js"></script>
to
<script src="https://cdnjs.cloudflare.com/ajax/libs/mocha/6.1.4/mocha.min.js"></script>

in the default html template, and view the stacktrace for a failing test.

Expected behavior: mocha is remove from the stack

Actual behavior: mocha exists (loudly) in the stack

Reproduces how often: 100%

Versions

  • 6.1.4

Additional Information

I have a fix prepared. It can be corrected with a one line addition to isMochaInternal with || ~line.indexOf(slash + 'mocha.min.js'). PR should be forth coming.

Pen - Existing Behavior and Pen - Post Fix

@juergba juergba added area: browser browser-specific area: integrations related to working with 3rd party software (e.g., babel, typescript) and removed unconfirmed-bug labels May 27, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: browser browser-specific area: integrations related to working with 3rd party software (e.g., babel, typescript)
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants