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: ensure plugins receive options correctly #276

Merged
merged 4 commits into from
Dec 16, 2020
Merged

Conversation

lmiller1990
Copy link
Member

@lmiller1990 lmiller1990 commented Dec 15, 2020

I noticed you cannot actually access options in your plugin, which makes them not very useful. I fixed it.

Recommend reviewing with whitespace OFF, I removed a useless describe, which made the diff bigger that it should be.

const plugin = (wrapper: VueWrapper<ComponentPublicInstance>) => {
return {
$el: wrapper.element // simple aliases
it('accepts options', () => {
Copy link
Member Author

Choose a reason for hiding this comment

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

this is the new test making sure options works correctly

expect(myMethod).toHaveBeenCalledTimes(1)
})
const wrapper = mountComponent()
// @ts-ignore
Copy link
Member

Choose a reason for hiding this comment

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

Is ts-ignore necessary here?

Copy link
Member Author

Choose a reason for hiding this comment

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

nope, removed

@lmiller1990 lmiller1990 merged commit 49b38c4 into master Dec 16, 2020
@lmiller1990 lmiller1990 deleted the fix-plugins branch December 16, 2020 05:06
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