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

Expose all arbitraries supported by fc.object as their own arbitraries #5499

Open
TomerAberbach opened this issue Dec 8, 2024 · 1 comment

Comments

@TomerAberbach
Copy link
Contributor

🚀 Feature Request

fc.object supports emitting all sorts of stuff for its values.

Some of them have their own arbitraries (e.g. withBigInt option corresponds to fc.bigInt), but some do not (e.g. withMap option doesn't have a corresponding exported arbitrary).

I think all of the things that fc.object can generate should be supported as standalone arbitraries too.

Motivation

It's convenient to be able to generate these types outside an object.

Example

// To generate Map<string, unknown>
fc.map(fc.string(), fc.anything())
@dubzzz
Copy link
Owner

dubzzz commented Dec 8, 2024

Good idea 👍 I think my main blocker was set as it was something in v2. But with v2 I don't have it anymore so I could clearly introduce these helpers.

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

2 participants