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

.satisfies() is too verbose, .notSatisfies() and .notDeepEquals() are of little use #47

Open
pygy opened this issue May 20, 2022 · 0 comments
Assignees
Labels
enhancement New feature or request

Comments

@pygy
Copy link
Member

pygy commented May 20, 2022

In o(myObject).satisfies(myValidator(someSepcification)), the satisfies bit takes too much space and hampers readability. o(myObject)._(matches(someSepcification)) would make more readable tests.

Also, the .notSatisfies() and .notDeepEquals() assertions are not very useful, and even IMO an anti-pattern, as any difference will make them pass, not necessarily the one the tester had in mind when designing the test. They should be. retired.

Here's the roadmap I propose

For v4.2.0:

Add ._() as a synonym to .satisfies().

Make o.warn = false. If the user sets o.warn = true, have .satisfies, .notSatisfies and .notDeepEquals issue warnings announcing future obsolescence (we can do that cleanly such that a single list is reported after publishing the report).

For v5.0.0

Make the warning unconditional, and state that the methods are deprecated.

Sometimes in the future

Remove them altogether.

@pygy pygy self-assigned this May 20, 2022
@pygy pygy added the enhancement New feature or request label May 20, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant