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

150
Views
Llamar a las mismas importaciones en un solo archivo de ciprés

Estamos usando Cypress v10 y nuestros archivos .cy.js siempre usan estas mismas importaciones:

 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"

¿Hay alguna forma mejor de incluir todas estas importaciones en una o dos líneas y no llamarlas manualmente de esta manera? Intenté crear un archivo complete.js que contiene el código copiado y pegado como se indicó anteriormente, luego intenté importar ese archivo complete.js, pero parece que no funciona. No estoy seguro si me estoy perdiendo algo.

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

0

Puede utilizar un archivo de índice para volver a exportar y simplificar la importación.

 // 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 Report

0

Para convertir exportaciones default en los archivos individuales a exportaciones con named en el índice de barril

 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 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!