Vue-test-utils: Add depth option to shallowMount

Created on 29 Jul 2018  路  4Comments  路  Source: vuejs/vue-test-utils

What problem does this feature solve?

Enable shallowMounting more than 1 level deep

What does the proposed API look like?

shallowMount(TestComponent, {
  depth: 2
})
feature request intend to implement

All 4 comments

this feature will help us a lot with performance: https://github.com/vuejs/vue-test-utils/issues/892
I believe: being able to only shallowMount component instead of mount will help us a lot. ^^

@eddyerburgh - did you have an idea of how you wanted to implement this? Happy to have a look at picking it up if you haven't.

I guess we just want to pass the depth value down to the patchRenderMixin and make createElement respect it?

I haven't looked at this recently, but something like that sounds good 馃憤

After discussion, we will not be implementing this.

If you have are having perf problems, use stubs to stub out the heavy components.

If you are having really serious perf problems you absolutely cannot solve, send me a message on Vueland and I will help you make your tests faster to the best of my ability.

Was this page helpful?
0 / 5 - 0 ratings