react-native-testing-library
Advanced tools
Comparing version 1.2.0 to 1.3.0
{ | ||
"name": "react-native-testing-library", | ||
"version": "1.2.0", | ||
"version": "1.3.0", | ||
"description": "Simple React Native testing utilities helping you write better tests with less effort", | ||
@@ -5,0 +5,0 @@ "main": "src/index.js", |
@@ -298,2 +298,3 @@ # react-native-testing-library | ||
debug.deep(<Component />); | ||
debug.deep(toJSON(), 'actually debug JSON too'); // useful when Component state changes | ||
``` | ||
@@ -300,0 +301,0 @@ |
@@ -23,6 +23,15 @@ // @flow | ||
*/ | ||
function debugDeep(instance: React.Element<*>, message?: any) { | ||
const { toJSON } = render(instance); | ||
console.log(format(toJSON()), message || ''); | ||
function debugDeep( | ||
instance: React.Element<*> | ?ReactTestRendererJSON, | ||
message?: any = '' | ||
) { | ||
try { | ||
// We're assuming React.Element<*> here and fallback to | ||
// rendering ?ReactTestRendererJSON | ||
// $FlowFixMe | ||
const { toJSON } = render(instance); | ||
console.log(format(toJSON()), message); | ||
} catch (e) { | ||
console.log(format(instance), message); | ||
} | ||
} | ||
@@ -29,0 +38,0 @@ |
@@ -61,3 +61,6 @@ import * as React from 'react'; | ||
shallow: DebugFunction; | ||
deep: (instance: React.ReactElement<any>, message?: string) => void; | ||
deep: ( | ||
instance: React.ReactElement<any> | ReactTestRendererJSON | null, | ||
message?: string | ||
) => void; | ||
}; | ||
@@ -64,0 +67,0 @@ |
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
78203
1544
376