Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

212
Visualizações
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 Respostas
Responde à pergunta

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 Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda