File tree Expand file tree Collapse file tree 2 files changed +44
-2
lines changed
Expand file tree Collapse file tree 2 files changed +44
-2
lines changed Original file line number Diff line number Diff line change 1- # ` .debug() => String `
1+ # ` .debug([options] ) => String `
22
33Returns an HTML-like string of the wrapper for debugging purposes. Useful to print out to the
44console when tests are not passing when you expect them to.
55
66
7+ #### Arguments
8+
9+ ` options ` (` Object ` [ optional] ):
10+ - ` options.ignoreProps ` : (` Boolean ` [ optional] ): Whether props should be omitted in the resulting string. Props are included by default.
11+
712#### Returns
813
914` String ` : The resulting string.
@@ -72,3 +77,18 @@ Would output the following to the console:
7277 < / div>
7378< / Foo>
7479```
80+ and:
81+ ``` jsx
82+ console .log (mount (< Bar id= " 2" / > ).find (Foo).debug ({ ignoreProps: true }));
83+ ```
84+ Would output the following to the console:
85+ <!-- eslint-disable -->
86+ ``` jsx
87+ < Foo>
88+ < div>
89+ < span>
90+ Foo
91+ < / span>
92+ < / div>
93+ < / Foo>
94+ ```
Original file line number Diff line number Diff line change 1- # ` .debug() => String `
1+ # ` .debug([options] ) => String `
22
33Returns an HTML-like string of the wrapper for debugging purposes. Useful to print out to the
44console when tests are not passing when you expect them to.
55
66
7+ #### Arguments
8+
9+ ` options ` (` Object ` [ optional] ):
10+ - ` options.ignoreProps ` : (` Boolean ` [ optional] ): Whether props should be omitted in the resulting string. Props are included by default.
11+
712#### Returns
813
914` String ` : The resulting string.
@@ -55,3 +60,20 @@ Outputs to console:
5560 <NumberOfPages pages="633 pages" />
5661</div>
5762```
63+
64+ ``` jsx
65+ const wrapper = shallow ((
66+ < Book
67+ title= " Huckleberry Finn"
68+ pages= " 633 pages"
69+ / >
70+ ));
71+ console .log (wrapper .debug ({ ignoreProps: true }));
72+ ```
73+ Outputs to console:
74+ ``` text
75+ <div>
76+ <h1>Huckleberry Finn</h1>
77+ <NumberOfPages />
78+ </div>
79+ ```
You can’t perform that action at this time.
0 commit comments