Skip to content

Commit f37ea42

Browse files
lmiller1990afontcu
andauthored
Apply suggestions from code review
Co-authored-by: Adrià Fontcuberta <[email protected]>
1 parent 133011b commit f37ea42

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

src/guide/stubs-shallow-mount.md

+5-3
Original file line numberDiff line numberDiff line change
@@ -188,10 +188,12 @@ Tests that use `mount` will render the entire component hierarchy, which is clos
188188

189189
On the other hand, tests using `shallow` are focused on a specific component. `shallow` can be useful for testing advanced components in complete isolation. If you just have one or two components that are not relevant to your tests, consider using `mount` in combination with `stubs` instead of `shallow`. The more you stub, the less production-like your test becomes.
190190

191-
Keep in mind that whether you are doing a full mount or a shallow render, good tests focus on inputs (`props` and user interaction, such as with `trigger`) and outputs (in the case of a component, the DOM elements that are rendered), not implementation details. So regardless of which mounting method you choose, keep these guidelines in mind.
191+
Keep in mind that whether you are doing a full mount or a shallow render, good tests focus on inputs (`props` and user interaction, such as with `trigger`) and outputs (the DOM elements that are rendered, and events), not implementation details.
192+
193+
So regardless of which mounting method you choose, we suggest keeping these guidelines in mind.
192194

193195
## Conclusion
194196

195-
- use `global.stubs` to replace a component with a dummy one that does nothing to simplify your tests
196-
- use `shallow: true` (or `shallowMount`) to stub out all custom components
197+
- use `global.stubs` to replace a component with a dummy one to simplify your tests
198+
- use `shallow: true` (or `shallowMount`) to stub out all child components
197199
- use `config.stubRenderDefaultSlot` to render the default `<slot>` for a stubbed component

0 commit comments

Comments
 (0)