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

358
Visualizações
jest-dom toBeVisible throws: TypeError: element.getRootNode is not a function

We recently updated some of our project dependencies and one of them was jest-dom, we went from v5.11.0 to v5.16.4. As of v5.11.10 they introduced a new condition to the toBeVisible method so that the element had to be in the document, as part of this check its implementation calls element.getRootNode.

Since this change, our tests which use toBeVisible now fail with the following message:

TypeError: element.getRootNode is not a function

I suspect that using node as the Jest testEnvironment is the issue and that for whatever reason the Node implementation doesn't have getRootNode and it probably should.

Is there a way round this (without changing the test environment to jsdom, since that causes loads of tests to break)?

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