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

167
Vistas
Make %o work in console.assert under Jest

I'm using jest (on top of babel/webpacker) to test my code but when I use assertions (console.assert) in jest I don't get the expected output.

If I run the following code in the node console I get a message like follows

art = {}
console.assert(false, "art not in user_articles art: %o", foo)
Assertion failed: art not in user_articles art: {}

But when I get an assertion failure in a jest test I get output like the following:

console.assert(user_articles.includes(art), "art not in user_articles art: %o", art)
AssertionError [ERR_ASSERTION]: art not in user_articles art: %o

Note that unlike when I run the assertion in the console %o isn't replaced with the value of the next parameter. What do I need to do to make console.assert replace %o with the desired parameter when I run it under jest?

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