MCPcopy
hub / github.com/testing-library/react-hooks-testing-library / useError

Function useError

src/__tests__/errorHook.test.ts:12–15  ·  view source on GitHub ↗
(shouldThrow?: boolean)

Source from the content-addressed store, hash-verified

10 runForRenderers(['default', 'dom', 'native', 'server/hydrated'], ({ renderHook }) => {
11 describe('synchronous', () => {
12 function useError(shouldThrow?: boolean) {
13 throwError(shouldThrow)
14 return true
15 }
16
17 test('should raise error', () => {
18 const { result } = renderHook(() => useError(true))

Callers 1

errorHook.test.tsFile · 0.85

Calls 1

throwErrorFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…