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

ToBeEmpty assertion in jest-extended collides with jest-dom's one #273

Open
DanielaValero opened this issue Mar 17, 2020 · 0 comments
Open

Comments

@DanielaValero
Copy link

Describe the feature you'd like:

Jest-Extended has an assertion named the same as jest-extended's one:

-> https://github.com/jest-community/jest-extended#tobeempty
-> https://github.com/testing-library/jest-dom#tobeempty

When both libs are used in the same project, in my case the version of jest-extended overwrites the one from jest-dom. But this might vary depending on the order used to add the libs

Describe alternatives you've considered:

Maybe an option is to add an alias for toBeEmpty named toBeEmptyValue or something ?

Teachability, Documentation, Adoption, Migration Strategy:

I am not sure at this moment how the things work, could it be an option to have 2 names for the same assertion?

If yes, then the documentation could say:
"if you are using jest-extended, then use toBeEmptyValue" or something like this

However, I have raised a feature request in Jest Itself asking for a feat that warns the user about the name collision and points out to a link where is documented a way to rename one of the colliding names in the project where the situation happens.

jestjs/jest#9678

It could be that the warning and the documentation of how to solve it in projects, might be enough to address this and similar situations like this one.

@DanielaValero DanielaValero changed the title ToBeEmpty matcher in jest-dom is also used in jest-extended ToBeEmpty assertion in jest-extentended collides with jest-dom's one Mar 17, 2020
@DanielaValero DanielaValero changed the title ToBeEmpty assertion in jest-extentended collides with jest-dom's one ToBeEmpty assertion in jest-extended collides with jest-dom's one Mar 17, 2020
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

1 participant