1- import ' @testing-library/jest-dom/extend-expect'
2- import { screen , render } from '..'
1+ import " @testing-library/jest-dom/extend-expect" ;
2+ import { screen , render } from ".." ;
33
44beforeEach ( ( ) => {
5- jest . spyOn ( console , ' log' ) . mockImplementation ( ( ) => { } )
6- } )
5+ jest . spyOn ( console , " log" ) . mockImplementation ( ( ) => { } ) ;
6+ } ) ;
77
88afterEach ( ( ) => {
99 // @ts -ignore
10- console . log . mockRestore ( )
11- } )
10+ console . log . mockRestore ( ) ;
11+ } ) ;
1212
13- test ( ' debug pretty prints the container' , ( ) => {
14- const HelloWorld = ( ) => ( < h1 > Hello World</ h1 > )
13+ test ( " debug pretty prints the container" , ( ) => {
14+ const HelloWorld = ( ) => < h1 > Hello World</ h1 > ;
1515
16- const { debug } = render ( ( ) => < HelloWorld /> )
16+ const { debug } = render ( ( ) => < HelloWorld /> ) ;
1717
18- debug ( )
18+ debug ( ) ;
1919
20- expect ( console . log ) . toHaveBeenCalledTimes ( 1 )
21- expect ( console . log ) . toHaveBeenCalledWith ( expect . stringContaining ( ' Hello World' ) )
22- } )
20+ expect ( console . log ) . toHaveBeenCalledTimes ( 1 ) ;
21+ expect ( console . log ) . toHaveBeenCalledWith ( expect . stringContaining ( " Hello World" ) ) ;
22+ } ) ;
2323
24- test ( ' debug pretty prints multiple containers' , ( ) => {
24+ test ( " debug pretty prints multiple containers" , ( ) => {
2525 const HelloWorld = ( ) => (
2626 < >
2727 < h1 data-testid = "testId" > Hello World</ h1 >
2828 < h1 data-testid = "testId" > Hello World</ h1 >
2929 </ >
30- )
31-
32- const { debug } = render ( ( ) => < HelloWorld /> )
33- const multipleElements = screen . getAllByTestId ( 'testId' )
34- debug ( multipleElements )
35- expect ( console . log ) . toHaveBeenCalledTimes ( 2 )
36- expect ( console . log ) . toHaveBeenCalledWith (
37- expect . stringContaining ( 'Hello World' )
38- )
39- } )
40-
41- test ( 'allows same arguments as prettyDOM' , ( ) => {
42- const HelloWorld = ( ) => < h1 > Hello World</ h1 >
43- const { debug, container } = render ( ( ) => < HelloWorld /> )
44- debug ( container , 6 , { highlight : false } )
45- expect ( console . log ) . toHaveBeenCalledTimes ( 1 )
30+ ) ;
31+
32+ const { debug } = render ( ( ) => < HelloWorld /> ) ;
33+ const multipleElements = screen . getAllByTestId ( "testId" ) ;
34+ debug ( multipleElements ) ;
35+ expect ( console . log ) . toHaveBeenCalledTimes ( 2 ) ;
36+ expect ( console . log ) . toHaveBeenCalledWith ( expect . stringContaining ( "Hello World" ) ) ;
37+ } ) ;
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 ) ;
4644 // @ts -ignore
4745 expect ( console . log . mock . calls [ 0 ] ) . toMatchInlineSnapshot ( `
4846 Array [
4947 "<div>
5048 ...",
5149 ]
52- ` )
53- } )
50+ ` ) ;
51+ } ) ;
0 commit comments