Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

115
Visualizações
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 à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda