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

156
Vistas
Calling the same imports onto a single cypress file

We are using Cypress v10 and our .cy.js files always use these same imports:

import Customers from "../imports/Customer"
import Search from "../imports/Search"
import PostComment from "../imports/PostComment"
import Feedback from "../imports/Feedback"
import Login from "../imports/Login"

Is there a better way that I can include all these imports in a single or two lines and not call them manually like this? I tried creating a complete.js file that contains copy pasted code as above then try to import that complete.js but it does not seem to work. I'm not sure if I'm missing anything.

about 4 years ago · Juan Pablo Isaza
2 Respuestas
Responde la pregunta

0

You can use an index file to re-export and simplify the import.

// imports/index.js
export { Customers } from 'Customer'
export { Search } from 'Search'
export { PostComment } from 'PostComment'
export { Feedback } from 'Feedback'
export { Login } from 'Login'

// test.cy.js
import { Customers, Search, PostComment, Feedback, Login } from '../imports'
about 4 years ago · Juan Pablo Isaza Denunciar

0

To convert default exports in the individual files to named exports in the barrel index

export { * as Customers } from 'Customer'
export { * as Search } from 'Search'
export { * as PostComment } from 'PostComment'
export { * as Feedback } from 'Feedback'
export { * as Login } from 'Login'
about 4 years ago · Juan Pablo Isaza Denunciar
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