5 ms·
The main problem with es modules is mocking in tests. How do people work around that issue?
by plopz 1y ago
The main problem with es modules is mocking in tests. How do people work around that issue?
- codedokode 1y agoYou don't use modules as a replacement for DI?
- giorgioz 1y agoYou either use Vitest for new projects or you use jest.unstable_mockModule for old Jest tests
- WilcoKruijer 1y agoDefine an interface, mock the implementation. How people outside of JS/TS have been doing it for years.