Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

120
Views
What's the proper way to have mocha's `describe` inside of fast-check's `property`

An alternative problem would be "How to check if mocha's describe has finished running all tests successfully".

I test an entity parameterized by several parameters (let's call it a and b). I have a test-suite for this entity encoded within mocha's `describe:

describe("entity", function () { 
  const entity = Entity(/*a =*/ 5, /*b =*/ 8);

  /* tests for entity */ 
}

The parameters are hard-coded. I want to property-check over them though (via fast-check). So, I enclose the Suite into a type-check's property:

fc.assert(fc.property(fc.integer(), fc.integer(), (a, b) => 
  describe("entity", function () { 
    const entity = Entity(a, b);

    /* tests for entity */ 
  }
));

The issue is, fast-check doesn't register failed tests from the suite. Thus, it doesn't report parameters' value (a and b) on failures and doesn't try to minimize them.

It could be fixed, by manually checking if the Suite returned by describe has finished running all the tests successfully, and failing if not.

How should I approach the problem?

about 4 years ago · Juan Pablo Isaza
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!