Skip to content
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

fix: don't record native events that are included in emits option (#444) #521

Merged
merged 1 commit into from
Apr 6, 2021
Merged

fix: don't record native events that are included in emits option (#444) #521

merged 1 commit into from
Apr 6, 2021

Conversation

aethr
Copy link
Contributor

@aethr aethr commented Apr 5, 2021

fix #444

I experimented with attaching the native event listener to the component's parentElement, hoping that vue's native event emitting behaviour would provide what we really want to collect, but this broke a couple of other tests.

Instead I opted to simply filter out any native event names that appear in emits while attaching our enumerated native event listeners. The added test passes and nothing else breaks so I think this should be adequate to fix #444.

Copy link
Member

@lmiller1990 lmiller1990 left a comment

Choose a reason for hiding this comment

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

nicely done, thanks!

@lmiller1990 lmiller1990 merged commit 8503fb8 into vuejs:master Apr 6, 2021
cexbrayat added a commit to cexbrayat/vue-test-utils-next that referenced this pull request Apr 19, 2021
The fix introduced in vuejs#521 only account for emits define as an array, but it can also be define as an object.
The latest rc.5 release breaks on components that use an object to define emits with:

    TypeError: emits.includes is not a function

This commit fixes the unit test to have both cases check, and the relevant code to properly handle the object case.
lmiller1990 pushed a commit that referenced this pull request Apr 19, 2021
The fix introduced in #521 only account for emits define as an array, but it can also be define as an object.
The latest rc.5 release breaks on components that use an object to define emits with:

    TypeError: emits.includes is not a function

This commit fixes the unit test to have both cases check, and the relevant code to properly handle the object case.
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.

emitted Collect content that should not be collected
2 participants