cucumber-js
cucumber-js copied to clipboard
Option for no backtrace
🤔 What's the problem you're trying to solve?
I'm trying to use the @playwright/test expect assertion library with Cucumber, and I have no need for the stack trace. Expect already gives me Playwright-specific trace of what lead to the failure, the Cucumber stack trace just shows me where I wrote the assertion.
✨ What's your proposed solution?
Add on "off" value to the existing --backtrace option.
⛏ Have you considered any alternatives or workarounds?
I read some stuff about regexing to filter out the traces or use additional plugins to take them out, but I'm trying to teach other people how to do this on all of their projects and that's an awful lot of hoops for a clear need.
📚 Any additional context?

Playwright + Playwright Expect + Cucumber seems like a pretty :100: stack, I feel like this would be useful to more people than just me.
This text was originally generated from a template, then edited by hand. You can modify the template here.
Interesting one @kylecoberly, thanks for raising.
I think customisation of how errors and stack traces are displayed is a good candidate for something a plugin could do, which is a concept we're kind of fleshing out at the moment.
Coincidentally the next thing I'm going to be looking at is our handling of errors and stack traces, so I'll keep this in mind and see what's feasible.
cc @mattwynne
Here's another example:

This one is Cucumber + supertest. The stack trace is supertest's code, not my app's. The same thing happens with expect:

Interesting, yeah.
If you had an extension point that allowed you to wrap the invocation of a step, the plugin could intercept and modify the backtrace there.