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