Closed SimenB closed 4 years ago
My quite hacky workaround:
StackUtils.nodeInternals().reduce(
(internals, internal) => {
const sourceWithoutParens = internal.source
// remove leading and trailing parens (which are escaped) and the $
.slice(2, internal.source.length - 3);
return internals.concat(internal, new RegExp(`at ${sourceWithoutParens}$`));
},
[],
)
@SimenB I think #49 should fix this.
One comment, with stack-utils 2.x you do not need to provide internals: StackUtils.nodeInternals()
- this is the new default.
Thanks for the quick PR! We cannot use stack-utils
v2 as it explodes in the browser ☹️
Thanks for the quick PR! We cannot use
stack-utils
v2 as it explodes in the browser :frowning_face:
Can you give details?
Actually turned out to be trivial, I just didn't look into it when things exploded previously: https://github.com/facebook/jest/pull/9533
One comment, with stack-utils 2.x you do not need to provide
internals: StackUtils.nodeInternals()
- this is the new default.
Should probably update the readme, that's where I got it from. 🙂 In jest we just use StackUtils.nodeInternals()
directly, and not the clean
function (we also use parse
, but I don't think that cares about the internals
opt?)
Expected result:
Received result: