Skip to content

Conversation

@jessevanassen
Copy link

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.

The emitted of @vue/test-utils is typed as emitted<T = unknown>(): Record<string, T[]> (https://github.com/vuejs/vue-test-utils-next/blob/v2.0.0-rc.6/src/vueWrapper.ts#L97).

Copy link
Member

@afontcu afontcu left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Totally right, nice catch!

@afontcu
Copy link
Member

afontcu commented May 8, 2021

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! 🙌

@afontcu afontcu closed this May 8, 2021
@jessevanassen
Copy link
Author

Thanks for the fix!

@jessevanassen jessevanassen deleted the fix-types-for-emitted branch May 11, 2021 08:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants