@testing-library/react-hooks
Advanced tools
Comparing version 5.0.2 to 5.0.3
@@ -57,5 +57,7 @@ "use strict"; | ||
get error() { | ||
var _results2; | ||
const { | ||
error | ||
} = results[results.length - 1]; | ||
} = (_results2 = results[results.length - 1]) != null ? _results2 : {}; | ||
return error; | ||
@@ -62,0 +64,0 @@ } |
{ | ||
"name": "@testing-library/react-hooks", | ||
"version": "5.0.2", | ||
"version": "5.0.3", | ||
"description": "Simple and complete React hooks testing utilities that encourage good testing practices.", | ||
@@ -5,0 +5,0 @@ "main": "lib/index.js", |
@@ -22,3 +22,3 @@ import { CreateRenderer, Renderer, RenderResult, RenderHookOptions } from '../types' | ||
get error() { | ||
const { error } = results[results.length - 1] | ||
const { error } = results[results.length - 1] ?? {} | ||
return error | ||
@@ -25,0 +25,0 @@ } |
@@ -55,2 +55,8 @@ import { renderHook } from '..' | ||
}) | ||
test('should return undefined if error is requested before suspension has resolved', async () => { | ||
const { result } = renderHook(() => useFetchName(true)) | ||
expect(result.error).toBe(undefined) | ||
}) | ||
}) |
@@ -55,2 +55,8 @@ import { renderHook } from '..' | ||
}) | ||
test('should return undefined if error is requested before suspension has resolved', async () => { | ||
const { result } = renderHook(() => useFetchName(true)) | ||
expect(result.error).toBe(undefined) | ||
}) | ||
}) |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
166922
4038