Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

166
Views
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
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!