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

117
Visualizações
How to implement React Enzyme testing in Bit Harmony

I'm trying to move an existing react library to Bit Harmony. The original library used Enzyme for testing. When I try to modify the demo my-react environment to use enzyme instead I hit an issue with specifying the location of the setupTests.js file.

I have modified the jest.config.js file located at demo/envs/my-react/jest to match the following:

module.exports = {
    setupFilesAfterEnv: [
    // I have tried multiple variations of the below path
      '<rootDir>/demo/envs/my-react/jest/setupTests.js',
    ],
  };

I have then created a setupTests.js file next to the jest.config.js file.

import { configure } from 'enzyme';
import Adapter from 'enzyme-adapter-react-16';

configure({ adapter: new Adapter() });

With this setup I still get the following error when running the test which seems to indicate the setupTests file is not being called. Enzyme Internal Error: Enzyme expects an adapter to be configured, but found none.

Note that copying the setupTests.js code directly into a test file allows the test to pass.

about 4 years ago · Juan Pablo Isaza
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