Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

VTL for Vue 3: Incorrect TypeScript type definitions for emitted #221

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
jessevanassen wants to merge 1 commit into testing-library:next from jessevanassen:fix-types-for-emitted
Closed

VTL for Vue 3: Incorrect TypeScript type definitions for emitted #221

jessevanassen wants to merge 1 commit into testing-library:next from jessevanassen:fix-types-for-emitted

Conversation

@jessevanassen
Copy link

@jessevanassen jessevanassen commented Apr 22, 2021

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!

jessevanassen reacted with laugh emoji
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! 🙌

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

Reviewers

@afontcu afontcu afontcu approved these changes

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

AltStyle によって変換されたページ (->オリジナル) /