Hi, Hoping someone can steer me in the right direction.
We have an App + Component library.
We are experiencing really slow unit tests. over 6 minutes to run the entire suite. Now there are a lot of tests but its + 30 seconds to run a single test in isolation even when its just rendering a basic dom element. After a lot of digging I’ve realised that the tests run 5s – 7s if decoupled from the component library.
The component library is a monolith of multiple packages. Each packages index file does a :
export * from ./components.tsx export * from ./components.types.ts export * from ‘./SessionStore’; … and much more
Now from what I can see this is causing the tests to parse pretty much the entire code base of the package when it just needs say access to a particular typing.
In the consuming app its impossible to just import one thing because even the files in the package reference the main index.js
Am I on the right track here or is the runtime parsing/compiling costs negligible and I should be looking for a problem in the codebase itself?