File tree 2 files changed +16
-3
lines changed
2 files changed +16
-3
lines changed Original file line number Diff line number Diff line change @@ -36,4 +36,17 @@ test('debug pretty prints multiple containers', () => {
36
36
)
37
37
} )
38
38
39
+ test ( 'allows same arguments as prettyDOM' , ( ) => {
40
+ const HelloWorld = ( ) => < h1 > Hello World</ h1 >
41
+ const { debug, container} = render ( < HelloWorld /> )
42
+ debug ( container , 6 , { highlight : false } )
43
+ expect ( console . log ) . toHaveBeenCalledTimes ( 1 )
44
+ expect ( console . log . mock . calls [ 0 ] ) . toMatchInlineSnapshot ( `
45
+ Array [
46
+ "<div>
47
+ ...",
48
+ ]
49
+ ` )
50
+ } )
51
+
39
52
/* eslint no-console:0 */
Original file line number Diff line number Diff line change @@ -60,12 +60,12 @@ function render(
60
60
return {
61
61
container,
62
62
baseElement,
63
- debug : ( el = baseElement ) =>
63
+ debug : ( el = baseElement , maxLength , options ) =>
64
64
Array . isArray ( el )
65
65
? // eslint-disable-next-line no-console
66
- el . forEach ( e => console . log ( prettyDOM ( e ) ) )
66
+ el . forEach ( e => console . log ( prettyDOM ( e , maxLength , options ) ) )
67
67
: // eslint-disable-next-line no-console,
68
- console . log ( prettyDOM ( el ) ) ,
68
+ console . log ( prettyDOM ( el , maxLength , options ) ) ,
69
69
unmount : ( ) => ReactDOM . unmountComponentAtNode ( container ) ,
70
70
rerender : rerenderUi => {
71
71
render ( wrapUiIfNeeded ( rerenderUi ) , { container, baseElement} )
You can’t perform that action at this time.
0 commit comments