-
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
#1888: adding stubbing for keep-alive #1889
Conversation
✅ Deploy Preview for vue-test-utils-docs ready!
To edit notification comments on pull requests, go to your Netlify site settings. |
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.
LGTM thanks 👍
I added a question for the other reviewers about supporting KeepAlive: true
@@ -124,6 +125,17 @@ export function createStubComponentsTransformer({ | |||
}) | |||
} | |||
|
|||
// stub keep-alive by default via config.global.stubs | |||
if ((type as any) === KeepAlive && 'keep-alive' in stubs) { |
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.
maybe we should support KeepAlive: true
as well?
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.
nit: we could also use isKeepAlive
instead of (type as any) === KeepAlive
(and do the same for Teleport)
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.
Maybe we just push this commit on behalf of the original author and ship this?
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.
This looks good to me.
It's very simple, the implementation is basically similar to what was done for
Teleport
, changing the rendering of children forKeepAlive
to a function.