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

Marking deprecated methods in docs #1536

Closed
kjugi opened this issue May 7, 2020 · 3 comments · Fixed by #1538
Closed

Marking deprecated methods in docs #1536

kjugi opened this issue May 7, 2020 · 3 comments · Fixed by #1538

Comments

@kjugi
Copy link

kjugi commented May 7, 2020

What problem does this feature solve?

Misunderstood in docs

What does the proposed API look like?

--

Is it worth to mark deprecated methods with some warning? And maybe worth to mention about using @testing-library/jest-dom as replace? Since in cli we have deprecation message, in docs we don't have such info.

Don't know why but it took me a minute to figure out that I need to use .element in my assert method to use i.e. toBeEmpty(). Maybe it's also worth to mention in docs.

so it looks like this now

expect(wrapper.find('.empty-el').element).toBeEmpty()

instead of:

expect(wrapper.find('.empty-el').isEmpty()).toBe(true)
@TheDutchCoder
Copy link

I would also like to see solutions mentioned to deprecations.

Things like [vue-test-utils]: overwriting methods via the 'methods' property is deprecated and will be removed in the next major version are incredibly unhelpful if there's no alternative offered and nothing to be found in the docs either.

@afontcu
Copy link
Member

afontcu commented May 7, 2020

I would also like to see solutions mentioned to deprecations.

Things like [vue-test-utils]: overwriting methods via the 'methods' property is deprecated and will be removed in the next major version are incredibly unhelpful if there's no alternative offered and nothing to be found in the docs either.

Hi! 👋😄

This answer (and the following conversation) might help to understand why methods is removed and why there's no direct alternative.

@TheDutchCoder
Copy link

@afontcu Thanks for pointing that out, but that's not a solution for checking if methods get called on mounted for example, as you can't mock/spy them anymore.

I guess the solution is to not test if those methods are called, but if their effects are applied. That's all good, until you deal with the DOM (where Jest/JSDOM in some cases severely lacks functionality).

Maybe some of us are approaching testing wrong (could totally be the case), but there should still be an explanation for deprecations, as well as documentation on how to solve them :)

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

Successfully merging a pull request may close this issue.

3 participants