jest
jest copied to clipboard
feat(jest-worker)!: replace `Worker` class export with `createWorkerFarm()` factory function
Part of #12274
Summary
Here is an attempt to replace Worker class exported from jest-worker with an async createWorkerFarm() factory function. This is needed to allow worker modules in ESM syntax.
The createWorkerFarm() function is implemented – it simply does some validation and returns and instance of WorkerFarm class. I have spend some time to make TypeScript usage smoother.
I managed to reshape jest-worker's implementation in jest-reporters and jest-runner, but got stuck with jest-haste-map. Will try again, not giving up yet (;
Test plan
Unit tests and type tests are added. All must pass.
@mrazauskas I'm planning to release 28 stable in the next few days (possibly this weekend). Just a heads up 🙂 I plan to have v29 come out when node 17 is EOL in June, so not too far into the future if you wanna wait. No rush either way 👍
Sure. I moved forward with refactoring jest-haste-map. That is tricky case. Will figure it out slowly.
Oh.. That’s to complicated to rebase and I can’t integrate it with haste module anyways. Leaving this for smarter than me (; Closing to have less noise around.
This pull request has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. Please note this issue tracker is not a help forum. We recommend using StackOverflow or our discord channel for questions.