mirror of
https://github.com/callstack/react-native-testing-library.git
synced 2026-09-18 23:09:04 +08:00
imp: Deprecate shallow (#264)
This commit is contained in:
+10
-1
@@ -1,11 +1,12 @@
|
||||
// @flow
|
||||
import * as React from 'react';
|
||||
import ShallowRenderer from 'react-test-renderer/shallow'; // eslint-disable-line import/no-extraneous-dependencies
|
||||
import { printDeprecationWarning } from './helpers/errors';
|
||||
|
||||
/**
|
||||
* Renders test component shallowly using react-test-renderer/shallow
|
||||
*/
|
||||
export default function shallow(
|
||||
export function shallowInternal(
|
||||
instance: ReactTestInstance | React.Element<any>
|
||||
) {
|
||||
const renderer = new ShallowRenderer();
|
||||
@@ -16,3 +17,11 @@ export default function shallow(
|
||||
output: renderer.getRenderOutput(),
|
||||
};
|
||||
}
|
||||
|
||||
export default function shallow(
|
||||
instance: ReactTestInstance | React.Element<any>
|
||||
) {
|
||||
printDeprecationWarning('shallow');
|
||||
|
||||
return shallowInternal(instance);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user