question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

jest tests are not working anymore with vee-validate 2.1.0-beta.4

See original GitHub issue

Versions

  • vee-validate: 2.1.0-beta.4
  • vue: 2.5.16

Describe the bug After installing 2.1.0-beta.4 jest tests are not working anymore that are using vee-validate. Reverted back to 2.1.0-beta.2 everything is working.

console.error node_modules/vue/dist/vue.runtime.common.js:589
    [Vue warn]: Error in directive validate update hook: "TypeError: Cannot read property '_transitionClasses' of undefined"

To Reproduce Steps to reproduce the behavior:

  1. Go to https://codesandbox.io/s/p37x443wmx
  2. Download project
  3. npm i
  4. npm test

Expected behavior

HelloWorld
    ✓ correctly mounted (22ms)

Demo Link https://codesandbox.io/s/p37x443wmx

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Reactions:2
  • Comments:8 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
ericbond007commented, Mar 25, 2019

I’m using mocha, but I’m seeing the same issue on my end. I’ve tried the solutions suggested above, including downgrading vee-validate, but I’m not making any progress.

I have a suspicion that the root $el is not being mounted correctly. That, or the vee-validate checks for $el aren’t working when using vue-test-utils localVue.

Has anyone else had any luck getting this to work? I’m this close to finding another validation library just so I can get my unit tests to work.

0reactions
logaretmcommented, Jun 7, 2019

@renestalder vue-test-utils plan to remove the sync rendering in future versions since Vue 3.x will not support that.

with that in mind, vue-test-utils doesn’t play well with async stuff, watchers, UI updates, etc… are all async in real-world, so a lot of issues will come out of any tool that will employ that fact since vee-validate is template based, it relies on that a lot.

For example, the directive tests fail because el is undefined which cannot happen in any real-world test, a directive is always placed on an element, there is no way el is undefined which is the main culprit for vue-test-utils.

Once a stable release is tagged I will review the tests, and see if there is an issue on vee-validate end. But normally the only workaround is to use sync: false and flushPromises which should work in most cases.

The only good news I have is that v3 works fine with the latest test-utils (directive deprecated), but I’m afraid a lot of stuff needs to be ironed out before I can start tagging 3.x.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Testing Caveats | VeeValidate
VeeValidate isn't special when it comes to testing, but a lot of issues seemed to miss a few important details about testing. This...
Read more >
Issues when running jest with bootstrap-vue - Stack Overflow
I am trying to make unit tests with jest and bootstrap-vue but got errors on Bootstrap-vue tags like : [Vue warn]: Unknown custom...
Read more >
vee-validate: Versions - Openbase
Full version history for vee-validate including change logs. ... Fixed extra validation being triggered with Vue 3.2.0-beta.x at the end of a resetField ......
Read more >
npm install timeout error | The AI Search Engine You Control
Some problem with your internet connection. Permissions are not sufficient for npm to modify files. Open side panel.
Read more >
patched-vee-validate - npm Package Health Analysis - Snyk
In the past month we didn't find any pull request activity or change in issues status has been detected for the GitHub repository....
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found