Investigate why spec/frontend/achievements/achievements_form_spec.js throws error after test environment was torn down with vue@3
Steps to investigate: 1. `VUE_VERSION=3 yarn run jest {ee/,}spec/frontend/ai/tanuki_bot/components/app_spec.js --no-skip-vue3` Example [job](https://gitlab.com/gitlab-org/gitlab/-/jobs/7566129855): ``` PASS spec/frontend/achievements/achievements_app_spec.js (198 MB heap size) ReferenceError: You are trying to access a property or method of the Jest environment after it has been torn down. From spec/frontend/achievements/achievements_form_spec.js. 17 | new Promise(setImmediate).then(() => { 18 | // wait for pending setTimeout()s > 19 | jest.runOnlyPendingTimers(); | ^ 20 | }), 21 | ); 22 | at runOnlyPendingTimers (spec/frontend/test_setup.js:19:10) [...snip...] FAIL spec/frontend/achievements/achievements_form_spec.js ● Test suite failed to run Unhandled Promise rejections: Error: Caught error after test environment was torn down expect(jest.fn()).toHaveBeenCalledWith(...expected) Expected: "Achievement has been added." Number of calls: 0, Error: Caught error after test environment was torn down Cannot call text on an empty VueWrapper., Error: Caught error after test environment was torn down Cannot call text on an empty VueWrapper., Error: Caught error after test environment was torn down expect(jest.fn()).toHaveBeenCalledWith(...expected) Expected: {"input": {"avatar": {}, "name": "Achievement", "namespaceId": "gid://gitlab/Group/7"}} Number of calls: 0 at tearDownEnv (node_modules/jest-runner/build/runTest.js:286:7) ```
issue