Add set_vue_error_handler helper to unify Vue.js 2 and 3
What does this MR do and why?
Related issue: Ensure all jest test suites could be run with @... (#390830 - closed)
This MR abstracts setting errorHandler
in Vue.js 2 and 3
In Vue.js 2 all apps shared single errorHandler via Vue.config.errorHandler
, which is no more the case for Vue.js 3.
When running with @vue/compat
@vue/test-utils@2
create Vue.js 3 root, so app receives own errorHandler
To deal with this one we introduce new helper and eslint rule to avoid new instance
Screenshots or screen recordings
N/A
How to set up and validate locally
- Run
VUE_VERSION=3 yarn jest spec/frontend/profile/account/components/update_username_spec.js
. It should not fail
MR acceptance checklist
This checklist encourages us to confirm any changes have been analyzed to reduce risks in quality, performance, reliability, security, and maintainability.
-
I have evaluated the MR acceptance checklist for this MR.