Skip to content

Is it possible to check multiple properties on the same generated values? #1539

Answered by dubzzz
dan-blank asked this question in Q&A
Discussion options

You must be logged in to vote

One of the solutions could be to use one expect per check:

describe('properties', () => {
  it('Properties X, Y should hold', () => {
    fc.assert(fc.property(reallyExpensiveToGenerateArb , sth => {
        expect(doesXhold(sth)).toBe(true);
        expect(doesYhold(sth)).toBe(true);
   }));
  });
});

Would it works in your case?

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@dan-blank
Comment options

Answer selected by dan-blank
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