jestjs/jest

Use cross browser stack trace utils

Open

#10023 opened on May 11, 2020

View on GitHub
 (5 comments) (0 reactions) (0 assignees)TypeScript (45,361 stars) (6,653 forks)batch import
:rocket: Feature RequestHelp WantedPinned

Description

🚀 Feature Proposal

It'd be awesome and fairly simple (I hope) to swap out stack-utils for https://github.com/stacktracejs/error-stack-parser which would give you the same metadata about stacks but work for non v8 stack traces

Motivation

We want to use jest-message-util to format errors from multiple browsers

Pitch

We are using a lot of jest in https://github.com/4Catalyzer/karma-jest which is a multi-browser environment via karma. Jest's excellent error formatting utils from jest-message-util work great (after mapping browser stacks to correct ones via source maps), but the formatting utils assume V8 based stack traces, which means FF and safari traces don't get nicely printed and call-site files are incorrectly parsed. This is due to some bad regexs and stack-utils which is designed for node.

If this seems like a good idea i can problem send a PR for it

Contributor guide