Better HN
top
new
best
ask
show
jobs
Log in
Sign up
Better HN
Comment
by
plopz
· 1y ago · 0 comments
The main problem with es modules is mocking in tests. How do people work around that issue?
Comments
[–]
WilcoKruijer
1y ago
Define an interface, mock the implementation. How people outside of JS/TS have been doing it for years.
[–]
giorgioz
1y ago
You either use Vitest for new projects or you use jest.unstable_mockModule for old Jest tests
[–]
codedokode
1y ago
You don't use modules as a replacement for DI?