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

496
Views
"ReferenceError: indexedDB no está definido" al probar el componente React con Jest

Creé una aplicación React usando Create React App, usa IndexedDB.

Cuando intento ejecutar una prueba, aparece este error:

 [UnhandledPromiseRejection: This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). The promise rejected with the reason "ReferenceError: indexedDB is not defined".] { code: 'ERR_UNHANDLED_REJECTION' }

Entiendo que el traje de prueba se ejecuta en un navegador sin interfaz que no tiene IndexedDB.

¿Cómo puedo manejar este caso?

about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

En realidad, Jest se usa para simular el DOM en la memoria, no en un navegador sin interfaz real. Por esa razón, debe simular ese tipo de API para que sus pruebas pasen.

Encontré un artículo que explica cómo burlarse de indexedDB en Jest

about 4 years ago · Juan Pablo Isaza Report
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!