Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Suppress logged warning on calls to propsData() #179

Open
mcmilleon-will opened this issue May 7, 2018 · 1 comment
Open

Suppress logged warning on calls to propsData() #179

mcmilleon-will opened this issue May 7, 2018 · 1 comment

Comments

@mcmilleon-will
Copy link

mcmilleon-will commented May 7, 2018

In our tests we often validate default data and prop values for the component under test using something like this:

componentUnderTest.data().should.deep.equal({
 // all expected data values go here
});

componentUnderTest.propsData().should.deep.equal({
 // all expected props values go here
});

We're using v4.2.0 and this works nicely for calls to data(), and it does also work when calling propsData(). However, when calling propsData(), we always get the warning:

functions returned by propsData() will not have this bound to the vue instance. Calling a propsData function that uses this will result in an error. You can access propsData functions by using the vue instance. e.g. to call a method function named propsDataFunc, call wrapper.vm.$props.propsDataFunc(). See #15');

I understand the reason for this warning message, but its muddying up my test output. Is there a way I can suppress it without muting other potential warnings from avoriaz?

@eddyerburgh
Copy link
Owner

There's not currently a way to hide the warnings, would you like to make a PR that adds the feature?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants