Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

116
Vistas
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
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda