Company logo
  • Empleos
  • Bootcamp
  • Acerca de nosotros
  • Para profesionales
    • Inicio
    • Empleos
    • Cursos y retos
    • Preguntas
    • Profesores
    • Bootcamp
  • Para empresas
    • Inicio
    • Nuestro proceso
    • Planes
    • Pruebas
    • Nómina
    • Blog
    • Calculadora

0

100
Vistas
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)?

7 months 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 empleo Planes Nuestro proceso Comercial
Legal
Términos y condiciones Política de privacidad
© 2023 PeakU Inc. All Rights Reserved.