Y
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
WilcoKruijer
444 days ago
Define an interface, mock the implementation. How people outside of JS/TS have been doing it for years.
link
giorgioz
444 days ago
You either use Vitest for new projects or you use jest.unstable_mockModule for old Jest tests
link
codedokode
444 days ago
You don't use modules as a replacement for DI?
link