Rename shallow to shallowMount
See original GitHub issueAs discussed with @eddyerburgh, Iāve had to explain to a lot of people that shallow
does actually mount, itās just a shallow mount. š This rename would make that clearer.
Issue Analytics
- State:
- Created 5 years ago
- Reactions:4
- Comments:6 (5 by maintainers)
Top Results From Across the Web
shallowMount() - Vue Test Utils
# shallowMount() ... Like mount , it creates a Wrapper that contains the mounted and rendered Vue component, but with stubbed child components....
Read more >Five Traps to Avoid While Unit Testing Vue.js
Shallow will only render your specific component and not child components. It makes your tests more robust, as you are only focusing on...
Read more >Knowing What To Test - Vue Component Unit Testing
In it, we'll shallow mount our components with Vue Test Utils, ... But hang on, what if someone accidentally renames title to name...
Read more >Why I Never Use Shallow Rendering - Kent C. Dodds
My test continues to work, but my component is broken. I could rename toggle to handleButtonClick (and update the corresponding onClickĀ ...
Read more >Unit Testing with Vue-test-utils - Section.io
In our project directory, we will rename the ... Import the shallowMount function from the vue-test-utils library and the component to test,Ā ...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Another potentially less confusing alternative could be a
shallow
option:Although I donāt have a strong opinion either way.
Since VTU is about unit testing, and that more or less means one does not mount/test child components, what about
mount
defaulting to āshallowā and then allowing the user set it to true when they need, like @lmiller1990ās approach?I understand that perhaps people would complain āhey, my components do not get properly mountedā if they donāt see child components mounted as well and didnāt read the docs about shallow/non-shallow.
Anyway, that is another idea that may or may not work.