-
-
Notifications
You must be signed in to change notification settings - Fork 230
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 Random.choice
#3314
add Random.choice
#3314
Conversation
🦋 Changeset detectedLatest commit: 2ec742f The changes in this PR will be included in the next version bump. This PR includes changesets to release 30 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
974b3a8
to
f9b6732
Compare
f9b6732
to
ca34a85
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Cool feature, I like
packages/effect/test/Random.test.ts
Outdated
it.live("choice", () => | ||
Effect.gen(function*() { | ||
expect(yield* Random.choice([1])).toEqual(1) | ||
expect(yield* Random.choice([1, 2, 3])).oneOf([1, 2, 3]) | ||
})) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- whats
it.live
? - maybe seed
Random
? and see that it
a. does not yield the same thing every time
b. is deterministic when seeded
Or even usefast-check
sorepeatN
won't be required like it's used in other tests?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
it.effect
provides aTestEnv
by default,it.live
opts-out- fast-check is probably a good way but even a repeated test would be fine
32ed129
to
716d157
Compare
a4c3408
to
95019bb
Compare
62144fc
to
0b36055
Compare
0b36055
to
fd2509f
Compare
676ed81
to
416da52
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
416da52
to
7f08ddc
Compare
No description provided.