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

feat(expect): added null as positive value for toBeOptionalOf #54

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

npwork
Copy link

@npwork npwork commented Dec 31, 2021

Description (What)

It would be nice to have null as a positive value(as well as undefined) for toBeOptionalOf

Justification (Why)

There are cases when object received from server (dto) has null as a value. In this case toBeOptionalOf fails which not correct. It should treat null the same way as undefined

How Can This Be Tested?

@JamieMason
Copy link
Owner

Thanks a lot, on my mobile just now but what I would want to do is instead put this behaviour in a new matcher called toBeNilOf, and maybe also add a toBeNullable of. This is just so it doesn't surprise anyone - although null means "nothing" it is still the presence of a value (even if that value describes nothing) - whereas undefined is the absence of a value.

Really hope that makes sense 😬

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 this pull request may close these issues.

None yet

2 participants