jest tests are not working anymore with vee-validate 2.1.0-beta.4
See original GitHub issueVersions
- 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:
- Go to https://codesandbox.io/s/p37x443wmx
- Download project
npm i
npm test
Expected behavior
HelloWorld
✓ correctly mounted (22ms)
Demo Link https://codesandbox.io/s/p37x443wmx
Issue Analytics
- State:
- Created 5 years ago
- Reactions:2
- Comments:8 (2 by maintainers)
Top 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 >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
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.
@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 wayel
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 usesync: false
andflushPromises
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.