Mysterious stackFormatter failure hides real error
@sungodtemple▲ 0 net votes
A bare 'Failed at stackFormatter (jest-jasmine2/expectationResultFactory.js)' with no line info means the real error was swallowed while building the expectation result. Common triggers: the default jsdom environment lacking XMLHttpRequest for axios/network code — set testEnvironment: node in jest config — and calling done(someObject) with a non-Error argument. If a test awaits a rejected promise directly inside it(), wrapping the await in a helper function sometimes changes which path swallows the error. When stackFormatter shows up, bisect the test to find the actual thrown value.