Skip to content

epic: shallow: true mounting option (previously shallowMount) #19

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
lmiller1990 opened this issue Feb 20, 2020 · 0 comments
Closed

epic: shallow: true mounting option (previously shallowMount) #19

lmiller1990 opened this issue Feb 20, 2020 · 0 comments

Comments

@lmiller1990
Copy link
Owner

Will probably rely on #9

Instead of shallowMount, I think we should have a shallow mounting option (discussed internally).

const Comp = mount({
  shallow: true
})

How this should work

shallowMount was pretty buggy in VTU beta. It should completely stub out and child components. So:

<template>
  <div>Content</div>
  <Foo />
  <Bar>
    <div>BAR</div>
  </Bar>
</template>

Should render as follows when using shallow:

<div>Content</div>
<foo-stub />
<bar-stub />

Whether it's <FooStub /> or <foo-stub> /> doesn't matter, the point is that the components are no longer rendered, nor is any of their code executed.

Things to consider:

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

No branches or pull requests

1 participant