-
-
Notifications
You must be signed in to change notification settings - Fork 3k
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
Error stack filtering should be configurable #1859
Labels
type: feature
enhancement proposal
Comments
If any are interested, here's a monkey patch work around, tested on mocha 2.3.0: var fail = Mocha.Runner.prototype.fail;
var originalFilter = Mocha.utils.stackTraceFilter();
function stackFilter(stack) {
return originalFilter(stack.replace("/components/", "/__componentz__/"))
.replace("/__componentz__/", "/components/");
}
Mocha.Runner.prototype.fail = function(test, err) {
if (err.stack) {
err.stack = stackFilter(err.stack);
}
return fail.apply(this, [test, err]);
}
mocha.fullTrace(); |
I think just changing |
👍 |
Proposed solution in #1880 |
Any way to do custom filtering in v3? |
Merged PR #1880 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
While I think excluding lines with
node_modules
substring from error stacks is reasonable, excluding stack lines withcomponents
substring seems very questionable. We have hit the issue in wallaby.js and I'm sure many people may have missing stack lines for theircomponents
folders and subfolders in their specs and source folders.Setting
fullTrace
somewhat helps, but it starts reportingnode_modules
stack lines.What do you think about having a setting to set an array of strings (or a function) to be used for filtering error stacks?
The text was updated successfully, but these errors were encountered: