As 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.
I prefer shallow because it's more terse, but I'm used to the enzyme API which has a shallow method.
It seems a lot of people are confused by shallow, so I'm in favor of renaming the method to shallowMount
Another potentially less confusing alternative could be a shallow option:
const wrapper = mount(Component, {
shallow: true
})
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.
I think the shallow option could be OK, except it's such a big change in behavior that I'd worry it could get lost with other options.
My preference is to rename shallow to shallowMount
It's easy enough to set up an alias from for people who prefer shallow, so I'm okay with this.
Most helpful comment
Another potentially less confusing alternative could be a
shallowoption:Although I don't have a strong opinion either way.