Great article. (I’ve come to similar conclusions, so I might be biased. 😂)

I was wondering, did you run into issues with cyclic dependencies that Jest would choke on? I use index.js files to “export { default as XYZ }” the components from subdirectories in a module, so that other components can import like:

import { ABC, DEF, XYZ } from “./common";

It makes things much cleaner, but I can end up with many cyclic graphs as components reference other components through these shared index.js files. Webpack seems to work it out, but Jest ends up slowing down, then finally blowing up.

I ended up splitting out my module aggregator, but Jest is still pretty slow.

Front-end web developer, React enthusiast, vagabond.

Love podcasts or audiobooks? Learn on the go with our new app.