I’m using vitest to write some unit tests in my react app, and I’ve been wondering why we don’t just use the node_module packages when necessary directly instead of mocking them?
I have included the methods from packages directly in my test files and everything is working fine, but I wonder if they really are? and if not, why?
for example I’ve imported the redux Provider directly from the package here:
const { container } = render(
<Provider store={store}>
<MyComponent />
</Provider>
);