-
-
Notifications
You must be signed in to change notification settings - Fork 58
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: add Type to fast-check arbitrary adapter #1151
base: main
Are you sure you want to change the base?
Conversation
@@ -162,7 +180,14 @@ describe("Arbitrary Generation", () => { | |||
it("bounded array", () => { | |||
const t = type("3<number[]<=5") | |||
const arbitrary = arkToArbitrary(t) | |||
assertProperty(arbitrary, t) | |||
// assertProperty(arbitrary, t) |
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.
Fix
return getArbitrary(fastCheckContext, nodeContext) | ||
} | ||
|
||
export type ArbitraryBuilderKeys = keyof ArbitraryBuilders | ||
|
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.
type ArbitraryBuilder<t = unknown> = (fastCheckContext: FastCheckContext) => Arbitrary<t>
export const arbitraryBuilders: ArbitraryBuilders = { | ||
number: fastCheckContext => generateNumberArbitrary(fastCheckContext), | ||
bigint: fastCheckContext => bigInt(), | ||
bigint: _fastCheckContext => bigInt(), |
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.
() => bigInt()
fastCheckAliasArbitrariesById: {}, | ||
currentNodeContext: node | ||
}) | ||
|
||
export const arbitraryBuilders: ArbitraryBuilders = { | ||
number: fastCheckContext => generateNumberArbitrary(fastCheckContext), |
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.
Rename these to ctx
when we're using them
const getArbitrary = ( | ||
fastCheckContext: FastCheckContext, | ||
nodeContext: NodeContext | ||
) => { |
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.
multiple branches annotate return type
"@ark/schema": "workspace:*", | ||
"@ark/util": "workspace:*" | ||
"@ark/util": "workspace:*", | ||
"fast-check": "3.18.0" |
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.
Use peer dependency + major version
No description provided.