Stacktraces don't filter mocha when minified #3921
Labels
area: browser
browser-specific
area: integrations
related to working with 3rd party software (e.g., babel, typescript)
Prerequisites
faq
labelnode node_modules/.bin/mocha --version
(Local) andmocha --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
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
The text was updated successfully, but these errors were encountered: