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

220
Vistas
Testcafe can't import files in configuration file

Using testcafe v1.17.0.

I have the configuration file .testcaferc.js with the newly merged global hooks property. In all of my fixtures, I have a before hook which does a certain amount of requests to an API, and with the new global hooks I wanted to move all of those API calls to the configuration file. (to remove duplicate code among other reasons)

However, it doesn't seem to be possible to import other files or packages into the configuration file as it throws the following error when I try to run testcafe:

An error has occurred while reading the "C:\Users\User\Documents\Projects\testcafe\.testcaferc.js" configuration file.

Not really sure what I need to do here to make this work.

There are two examples of what I need to import into the config file. Either one of them throws the aforementioned error.

import Shared from "./shared"; // Custom JS file containing functions for the API requests
import clonedeep from 'lodash.clonedeep';
about 4 years ago · Juan Pablo Isaza
1 Respuestas
Responde la pregunta

0

The .testcaferc.js configuration file should be in the CommonJS format, so you should use require instead of import. Your imported modules should also be written in the cjs format.

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