In the docs for emitted, it is listed that it is an alias for the emitted function of @vue/test-utils. However, the type definition of vue-testing-library's emitted is not correct.
The emitted of vue-testing-library is typed as emitted(): EmitsOptions. However, EmitsOptions (which is imported from Vue) is not correct because that's the type used for defining which events a component can emit, not which events have been emitted.
Hi mate! Just fixed in 6.4.1. I was having some issues with tests and the pipeline so I ended up doing it by hand :) Thank you for finding this one, though! 🙌
In the docs for
emitted
, it is listed that it is an alias for theemitted
function of@vue/test-utils
. However, the type definition ofvue-testing-library
'semitted
is not correct.The
emitted
ofvue-testing-library
is typed asemitted(): EmitsOptions
. However,EmitsOptions
(which is imported fromVue
) is not correct because that's the type used for defining which events a component can emit, not which events have been emitted.The
emitted
of@vue/test-utils
is typed asemitted<T = unknown>(): Record<string, T[]>
(https://github.com/vuejs/vue-test-utils-next/blob/v2.0.0-rc.6/src/vueWrapper.ts#L97).