Closed ockam closed 1 year ago
Thank you for letting me know 👍🏼 Might be best to downgrade until I can get a fix.
Explicitly defining the mock does the trick:
jest.mock('react-autosave', () => ({ useAutosave: jest.fn() }))
Nice! I will try to get it working again in the future anyway. What major version of jest are you using? 26, 27, or 28?
Jest 27.5.1 with React 17.0.2
This should be fixed in 0.4.2
Just installed the 0.4.0 update (thanks for the quick update) and the useAutosave hook mock (jest-mock) I was using in my tests stopped working.
It fails with the error
Failed to get mock metadata: [...]/node_modules/react-autosave/dist/react-autosave.umd.js
.I’m no test guru, so I don’t have a fix to suggest, but I continue trying to find a workaround on my end.