$ the-wire · showcase
test-utils records emitted events once per mount again
By RepoJournal · Filed · About Vue.js · Composed from the cited sources · methodology
@vuejs/test-utils fixes a devtools-hook regression that multiplied every recorded emit by the number of prior mounts, and it ships as one change arriving twice on the wire today.
fix: record emitted events once when a devtools hook is installed vuejs/test-utils
When __VUE_DEVTOOLS_GLOBAL_HOOK__ is present, each mount was wrapping hook.emit one more time, so after N mounts a single $emit landed in emitted() N times, and replacing the hook after Vue's renderer was created left emitted() empty entirely. VTU now installs its hook the way it did before #2311 and forwards events to the current global hook.
fix: record emitted events once when a devtools hook is installed vuejs/test-utils
The commit making the same fix is the one you can pin to: e449126c5451742d094ebad7c686bf276467666b always installs the VTU hook and forwards to the current global hook rather than re-wrapping the existing one. If you stub __VUE_DEVTOOLS_GLOBAL_HOOK__ in tests and assert on emitted(), this is the version to be on.