File tree Expand file tree Collapse file tree 2 files changed +12
-3
lines changed Expand file tree Collapse file tree 2 files changed +12
-3
lines changed Original file line number Diff line number Diff line change 1
1
// @flow
2
2
import * as React from 'react' ;
3
- import shallow from '../shallow' ;
3
+ import { shallowInternal } from '../shallow' ;
4
4
import format from './format' ;
5
5
6
6
/**
@@ -10,7 +10,7 @@ export default function debugShallow(
10
10
instance : ReactTestInstance | React . Element < any > ,
11
11
message ?: any
12
12
) {
13
- const { output } = shallow ( instance ) ;
13
+ const { output } = shallowInternal ( instance ) ;
14
14
15
15
if ( message ) {
16
16
console . log ( `${ message } \n\n` , format ( output ) ) ;
Original file line number Diff line number Diff line change 1
1
// @flow
2
2
import * as React from 'react' ;
3
3
import ShallowRenderer from 'react-test-renderer/shallow' ; // eslint-disable-line import/no-extraneous-dependencies
4
+ import { printDeprecationWarning } from './helpers/errors' ;
4
5
5
6
/**
6
7
* Renders test component shallowly using react-test-renderer/shallow
7
8
*/
8
- export default function shallow (
9
+ export function shallowInternal (
9
10
instance : ReactTestInstance | React . Element < any >
10
11
) {
11
12
const renderer = new ShallowRenderer ( ) ;
@@ -16,3 +17,11 @@ export default function shallow(
16
17
output : renderer . getRenderOutput ( ) ,
17
18
} ;
18
19
}
20
+
21
+ export default function shallow (
22
+ instance : ReactTestInstance | React . Element < any >
23
+ ) {
24
+ printDeprecationWarning ( 'shallow' ) ;
25
+
26
+ return shallowInternal ( instance ) ;
27
+ }
You can’t perform that action at this time.
0 commit comments