File tree Expand file tree Collapse file tree 2 files changed +16
-3
lines changed Expand file tree Collapse file tree 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', () => {
3636 )
3737} )
3838
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+
3952/* eslint no-console:0 */
Original file line number Diff line number Diff line change @@ -60,12 +60,12 @@ function render(
6060 return {
6161 container,
6262 baseElement,
63- debug : ( el = baseElement ) =>
63+ debug : ( el = baseElement , maxLength , options ) =>
6464 Array . isArray ( el )
6565 ? // eslint-disable-next-line no-console
66- el . forEach ( e => console . log ( prettyDOM ( e ) ) )
66+ el . forEach ( e => console . log ( prettyDOM ( e , maxLength , options ) ) )
6767 : // eslint-disable-next-line no-console,
68- console . log ( prettyDOM ( el ) ) ,
68+ console . log ( prettyDOM ( el , maxLength , options ) ) ,
6969 unmount : ( ) => ReactDOM . unmountComponentAtNode ( container ) ,
7070 rerender : rerenderUi => {
7171 render ( wrapUiIfNeeded ( rerenderUi ) , { container, baseElement} )
You can’t perform that action at this time.
0 commit comments