You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have a setup where I'm using Jest and vue-test-utils to mount and test my components. Some of the inner components use the v-observe-visibility directive. However, it breaks/slows down considerably the tests. It looks like it really doesn't like being run in testing virtual DOM. I got around this by adding:
v-observe-visibility="isTest ? false : onRulesVisible" i
nside my components. However, this feels very clunky. It'd be nice if there were a hook we could access to disable the directive when running tests. I'll admit, I haven't taken a look at the inner workings of the directive. I can't be the only one who has run into this problem.
The text was updated successfully, but these errors were encountered:
I have a setup where I'm using Jest and vue-test-utils to mount and test my components. Some of the inner components use the v-observe-visibility directive. However, it breaks/slows down considerably the tests. It looks like it really doesn't like being run in testing virtual DOM. I got around this by adding:
Vue.prototype.isTest = process.env.JEST_WORKER_ID !== undefined
in my startup config. And then a
v-observe-visibility="isTest ? false : onRulesVisible"
inside my components. However, this feels very clunky. It'd be nice if there were a hook we could access to disable the directive when running tests. I'll admit, I haven't taken a look at the inner workings of the directive. I can't be the only one who has run into this problem.
The text was updated successfully, but these errors were encountered: