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

332
Views
Jest prueba la importación dinámica con jest-next-dynamic

Estoy tratando de probar la importación dinámica en nextjs versión 10.2.3, intenté usar la biblioteca jest-next-dynamic que evita arrojar errores

Error de tipo: require.resolveWeak

pero cuando depuro el componente en el caso de prueba de broma, obtengo el resultado inferior y no puedo obtener el componente real que debería cargarse

 <ForwardRef(LoadableComponent) .../>

mi caso de prueba

 it('should render Image component from next/Image', () => { await preloadAll(); defaultProps = getDefaultProps(imgSrcFromAssetsLocation); const ContainerImage = shallow(<ContainerImage { ...defaultProps } />); console.log(ContainerImage.debug()); expect(ContainerImage.prop('layout')).toEqual('responsive'); });
about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

Después de un tiempo, descubrí que debemos esperar a que se cargue el elemento dinámico en el caso de prueba usando waitFor o algo similar, la documentación de "jest-next-dynamic" no incluye esto, encontré esto desde abajo github repo github repo with example

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!