How to make import with “?” sign work with react testing library and jest
I have react/nextjs/MUI app.
I need to have 2 different independent instances of the same module using the same codebase and for this purpose I use the cool hack that works fine:
in all files
where I need the first instance I use:
Can’t test React Idle Timer’s useIdleTimer hook when inside a custom hook
In a react app, I have a custom hook which calls useIdleTimer
docs here, amongst other things.
Jest API class using axios returning undefined
I have a react and typescript class containing reusable API calls set up using axios to be imported and utilised to interact with a REST endpoint: