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

314
Views
Jest Vue: ¿Es posible cargar importaciones dinámicas para instantáneas?

Estoy tratando de realizar una prueba unitaria de un componente Vue que carga dinámicamente su componente secundario. El problema es que las utilidades Jest / Vue no parecen poder procesarlo. ¿Hay alguna manera de hacer esto?

mi componente

 <template> <component :is="component" v-bind="props" /> </template> <script> const components = { dog: () => import('./dog.vue'), cat: () => import('./cat.vue') } export default { props: { type: String } computed: { component() { return components[this.type] } props() { ... } } } </script>

esta es mi prueba

 ... it('renders correctly', async () => { const wrapper = mount(Component, { ... }) expect(wrapper.element).toMatchSnapshot() }) ...

Y este es el archivo de instantánea resultante.

 // Jest Snapshot v1 exports[`Markdown Token renders correctly 1`] = `<!---->`;

Gracias por adelantado :)

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!