Skip to content

arbitrary reuse and check signatures in mocha BDD #2134

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

You must be logged in to vote

Hey,

Here are some answers for your questions:

  1. Is there a definitive way to tell from the check results, a RunDetails, whether the property threw an error or returned falsy? I know the failed property indicates whether it failed in general, but the error property seems to be populated whether it returned or threw.

Actually not really. As you said the error field will always be set in case of non-fulfill property. On fast-heck side return false or throwing is fully equivalent. The potential only thing you could do it checking for a precise error. You could probably do something like:

const out = fc.check(fc.property(...arbs, predicate));
if (out.failed) {
  if (out.error === 'Property …

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@ssube
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