Vue test utils require extra parameters in Karma tests
The following discussion from gitlab-ee!8593 should be addressed:
-
@pslaughter started a discussion: (+3 comments) vent: This was causing me to lose my mind... Before adding
localVueandsync: false, I was experiencing some very weird behavior with thesevue-test-utilstests.The Problems
The tests worked when ran individually, but running
yarn run karmarevealed the following:- Unrelated tests were failing their assertions.
- This test triggered a
Max call stack size exceeded. It looked like there was a forever loop when trying toshallowMount🤷 .
Why
localVue?It looks like there's some issues when
vue-test-utilstouches a component and the component is used in a separate test that doesn't usevue-test-utils. For example, when I tried runningmr_widget_pipeline_container_spec.jswithout settinglocalVueit would "stub" the childpipelinecomponent, causing it to never be rendered properly in any other test😱 .Why
sync: false?I honestly have no idea why this component was triggering a forever loop, but it's probably related to specs stepping onto eachother's toes somehow... I'm thinking that the
Iconcomponent might be the real culprit...(Pinging @iamphill & @psimyn since you might be interested in this)