Skip to content

Setting showDeprecationWarnings to false does not hide attachToDocument deprecation warnings. #1545

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

Closed
phiter opened this issue May 13, 2020 · 4 comments · Fixed by #1546
Closed

Comments

@phiter
Copy link
Contributor

phiter commented May 13, 2020

Version

1.0.0

Reproduction link

if ('attachToDocument' in options) {
warn(
`options.attachToDocument is deprecated in favor of options.attachTo and will be removed in a future release`
)
}

Steps to reproduce

  1. Configure test utils to not show deprecation warnings using config.showDeprecationWarnings = false;
  2. Set attachToDocument to true in one of your mount functions.
  3. Run tests and check console.

What is expected?

Deprecation warnings should not be shown

What is actually happening?

They are showing


I didn't make a reproduction repository because the error is simple and I linked the exact line with the issue above. That line should use warnDeprecated instead of warn.

There should also be a unit test to cover attachToDocument. I noticed that there is a single test to check if this config works.

it('allows control deprecation warnings visibility', () => {
config.showDeprecationWarnings = true
const Component = {
name: 'Foo',
template: '<div>Foo</div>'
}
const wrapper = mountingMethod(Component)
wrapper.name()
expect(console.error).to.be.calledWith(sandbox.match('name is deprecated'))
config.showDeprecationWarnings = false
wrapper.name()
expect(console.error).to.have.callCount(1)
})
})

@lmiller1990
Copy link
Member

lmiller1990 commented May 14, 2020

Thanks. I will tackle these deprecation warnings this weekend. We definitely did not handle this well or thoroughly enough.

I will also make the PR template less annoying, not every issue needs a repro.

@phiter
Copy link
Contributor Author

phiter commented May 14, 2020

@lmiller1990 I have fixed it already in my PR but I can't get the test working, can you check it?

lmiller1990 pushed a commit that referenced this issue May 14, 2020
* fix(config): add attachToDocument conditional deprecation message

resolves #1545

* test(config): add attachToDocument deprecation warning test
@lmiller1990
Copy link
Member

This will go out in the next few days

@lmiller1990
Copy link
Member

lmiller1990 commented May 17, 2020

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

Successfully merging a pull request may close this issue.

2 participants