karma-jasmine
karma-jasmine copied to clipboard
Support reporting unhandledrejection errors.
New feature, so far only chrome perhaps: https://developer.mozilla.org/en-US/docs/Web/API/WindowEventHandlers/onunhandledrejection
I would send a PR for this if encouraged.
@johnjbarton why would you think it should be implemented in the karma-jasmine adapter?
Thanks
The unhandled rejections are a kind of global test error message. (Of course like, all error messages, some may be harmless to the test objective). Generally test error messages are reported via karma reporters. Therefore my goal is to emit the unhandled rejection error messages in the reporter.
Based on the system architecture, karma-jasmine is the component that routes information to the reporter. The framework adapters like karma-jasmine call karma-runner's in-browser functions with data that karma-runner ferries to the server and emits via its reporter API.
So it seemed reasonable to me to us the karma-jasmine adapter to report the unhandled rejections.
I suppose this could be built into the karma-runner context as it is not jasmine specific.