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

Add toBeTruthy, toBeFalsy / toBeDefined validators #85

Closed
dmaretskyi opened this issue Dec 3, 2020 · 3 comments
Closed

Add toBeTruthy, toBeFalsy / toBeDefined validators #85

dmaretskyi opened this issue Dec 3, 2020 · 3 comments
Assignees

Comments

@dmaretskyi
Copy link

No description provided.

@sz-piotr
Copy link
Member

sz-piotr commented Dec 5, 2020

How about toBeNullish? It could cover null and undefined

@krzkaczor
Copy link
Contributor

krzkaczor commented Dec 15, 2020

Let's sum up. You're proposing new validators / matchers:

  • toBeTruthy / expect.truthy - matches truthy values !!val === true
  • toBeFalsy / expect.falsy - matches falsy values !val === true
  • toBeDefined / expect.defined - matches everything other than null and undefined
  • toBeNullish / expect.nullish - matches null and undefined

@marik-d @sz-piotr if you have any suggestions to the behavior or naming now's the time.

@Kamrulhasan12345
Copy link

Any updates on this?

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

5 participants