-
Notifications
You must be signed in to change notification settings - Fork 257
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
bugfix/unmounting-on-multi-root #182
bugfix/unmounting-on-multi-root #182
Conversation
jw-foss
commented
Aug 20, 2020
•
edited
Loading
edited
- Fix Unmount on multi-root component causes JSDOM error #181
- Fix the logic which causes unmounting fail when it's multi-root component
- Fix the logic which causes unmounting fail when it's multi-root component
I went through the mounting function and found out that the whole part of |
const wrapper = mount(Component, { | ||
props: {}, | ||
global: { | ||
config: { | ||
errorHandler | ||
} | ||
} | ||
} as any) // The type checking keeps complaning about unmatched type which might be a bug |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Here I tried it with
mount(Component, {
global: {
config: ...
}
}
Type system seems not agree with this syntax when custom component is mounting with global options
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Interesting, will deal with the types later, it's outside the scope of this ticket. Great job!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Code looks good, just a small comment - let's keep the codebase boring and simple :)
const wrapper = mount(Component, { | ||
props: {}, | ||
global: { | ||
config: { | ||
errorHandler | ||
} | ||
} | ||
} as any) // The type checking keeps complaning about unmatched type which might be a bug |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Interesting, will deal with the types later, it's outside the scope of this ticket. Great job!
tests/unmount.spec.ts
Outdated
const errorHandler = jest.fn() | ||
const Component = defineComponent({ | ||
template: ` | ||
<div>${AXIOM}</div> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think we need AXIOM
, it doesn't really add much to the test. I am not sure who Rem is.
Can we just have <div /><div />
or something?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yep, sure. I'll remove the text later
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great, I will do a release in the next few days with this feature.
Nice! Thanks for the quick response though |