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 ability to customize the null of fc.option #401

Merged
merged 1 commit into from
Sep 9, 2019
Merged

Conversation

dubzzz
Copy link
Owner

@dubzzz dubzzz commented Aug 16, 2019

Why is this PR for?

Current implementation of fc.option does not allow the user to produce something else than null.

By using some tricks we can make it produce other values: fc.option(arb).map(v => v === null ? otherValueForNull : v).

This PR updates fc.option so that it can receives an extra parameter to specify the null value we want it to produce: fc.option(arb, { nil: undefined }).

Incomplete PR, need to update UTests and document the change

In a nutshell

  • New feature
  • Fix an issue
  • Documentation improvement
  • Other: please explain

Potential impacts

Nothing.

@coveralls
Copy link

Coverage Status

Coverage decreased (-0.4%) to 96.586% when pulling c159b18 on feat/option-nil into ba52c39 on master.

@dubzzz dubzzz merged commit e1dedb2 into master Sep 9, 2019
@dubzzz dubzzz deleted the feat/option-nil branch September 9, 2019 00:10
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.

2 participants