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?