4 ms·
It's not a secret what jest does. There are a few abstractions to jump through, but I find jest's code very readable overall. By default the `workerThreads` opt
by mhagemeister 3y ago
It's not a secret what jest does. There are a few abstractions to jump through, but I find jest's code very readable overall. By default the `workerThreads` option is set to `false`. Then we reach their `WorkerPool` class which pools the test runs. The "Worker" in the name is not to be confused with WebWorkers or node's worker_threads. It's merely the term the jest team has chosen. Inside that and because workerThreads is set to false, we instantiate a child process here
https://github.com/jestjs/jest/blob/00ef0ed0a03764f24ff568bc87dcc1c203d28625/packages/jest-worker/src/WorkerPool.ts#L36 https://github.com/jestjs/jest/blob/00ef0ed0a03764f24ff568bc...
- Tade0 3y agoThis doesn't fully answer my question, because in the issue I linked it's explained that Jest might to decide to implicitly apply `runInBand` when... it feels like apparently, because that's not well documented. I see it as a major design flaw, because I have had mysterious, impossible to debug errors happen due to this in just about every project that used Jest that I've been in.