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

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