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

103
Visualizações
How to set Jest test retries globally

Some of my test files in Jest are flaky. Identifying individual files and adding jest.retryTimes(2) to the top of those files helps. I would like to add that as a global setting rather than needing to add that line to the top of every file.

Is there a way to configure Jest so that it will always retry failed tests rather than needing to add that setting in each file?

Thanks!

about 4 years ago · Santiago Trujillo
1 Respostas
Responde à pergunta

0

You can use setupFilesAfterEnv:[array] in your jest config file https://jestjs.io/docs/configuration#setupfilesafterenv-array

Make a setup file (e.g setup-jest.js) and include the jest.retryTimes(2) in there.

// setup-jest.js

jest.retryTimes(2)


// jest.config.js

module.exports = {
  setupFilesAfterEnv: ['<rootDir>/setup-jest.js'],
  ...
};
about 4 years ago · Santiago Trujillo Relatório
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