Hacker News new | ask | show | jobs
by plopz 444 days ago
The main problem with es modules is mocking in tests. How do people work around that issue?
3 comments

Define an interface, mock the implementation. How people outside of JS/TS have been doing it for years.
You either use Vitest for new projects or you use jest.unstable_mockModule for old Jest tests
You don't use modules as a replacement for DI?