Closed juhasev closed 6 years ago
This is something you need to expect when testing certain components. You can see how we handle this in our tests.
If you are using jest, instead of jasmine; you can overwrite the global.console
:
// tests/utils.js <-- Or whatever you want to call it
global.console = {
...global.console, // get the default values first and overwrite the ones that we want:
error: jest.fn(),
warn: jest.fn(),
info: jest.fn(),
}
And import it in the tests needed ;)
@johnleider could you post your "way of handling this" instead of letting us search for it?
Or either fix the issue?
couldn't you set a if (!data-app) return;
somewhere to avoid warnings?
this is annoying and I don't like to do crappy stuff in my tests to avoid such warnings
const el = document.createElement('div')
el.setAttribute('data-app', true)
document.body.appendChild(el)
Versions and Environment
Vuetify: 1.0.4 Vue: 2.5.13 Browsers: Chrome 64.0.3282.186 OS: Mac OS 10.13.3
Steps to reproduce
Create minimal component using toolbar and tooltip:
Next in your test mount the component twice:
Expected Behavior
No errors
Actual Behavior
First shallow mount works fine, no errors. However the second mount results into errors. I believe data-app bug has been in other components and has been fixed else where but these are still not working. Something must be changing in the global scope...
Reproduction Link
https://jsfiddle.com/
Other comments
My apologies for not putting this up as a running example. I took this out of a bigger project and stripped it down to the bare minimum. Should be easy to plug in and run.