How do I test errors in a hook that suspends before it throws?
Using testing-library/react, I can use a combination of renderHook
, expect
and toThrowError
to check that the hook throws an error under certain conditions:
Using testing-library/react, I can use a combination of renderHook
, expect
and toThrowError
to check that the hook throws an error under certain conditions: