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

120
Vistas
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 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