We're on the cusp of 2022 and most software is now written in JavaScript, but it is still virtually impossible to fail integration tests on a JavaScript error and get a useful stack trace from the browser.
This gist includes my description of the problem and sample code from my attempts to solve it.
What I want:
- Integration test should fail (preferabbly immediately) on any uncaught JavaScript error (
window.onerror
,unhandledrejection
, etc) - The stack trace should use source maps and be close to what browsers show in DevTools