Skip to content

Is there a way to use this with uvu? #2004

Answered by dubzzz
jasikpark asked this question in Q&A
Discussion options

You must be logged in to vote

Normally fast-check is supposed to be framework agnostic so yes.

Actually from what I see in the documentation of uvu, you will have to wrap the calls to fast-check within the test function as follow:

// For synchronous properties
test('My property', () => {
  fc.assert(fc.property(
    // here your arbitraries
    // here the test callback
  ));
});

// For asynchronous properties
test('My async property', async () => {
  await fc.assert(fc.asyncProperty(
    // here your arbitraries
    // here the test callback
  ));
});
// Alternatively if you return the output of fc.assert (just hiding the async/await but uvu still sees Promises)
test('My async property', () => 
  fc.assert(fc.asyncP…

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@jasikpark
Comment options

Answer selected by dubzzz
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants