-
-
Notifications
You must be signed in to change notification settings - Fork 2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
2a0de29
commit 05c16c1
Showing
7 changed files
with
252 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,76 @@ | ||
# `.debug() => String` | ||
|
||
Returns an html-like string of the wrapper for debugging purposes. Useful to print out to the | ||
This comment has been minimized.
Sorry, something went wrong. |
||
console when tests are not passing when you expect them to. | ||
|
||
|
||
#### Returns | ||
|
||
`String`: The resulting string. | ||
|
||
|
||
|
||
#### Examples | ||
|
||
Say we have the following components: | ||
```jsx | ||
class Foo extends React.Component { | ||
render() { | ||
return ( | ||
<div className="foo"> | ||
<span>Foo</span> | ||
</div> | ||
); | ||
} | ||
} | ||
|
||
class Bar extends React.Component { | ||
render() { | ||
return ( | ||
<div className="bar"> | ||
<span>Non-Foo</span> | ||
<Foo baz="bax" /> | ||
</div> | ||
); | ||
} | ||
} | ||
``` | ||
|
||
In this case, running: | ||
```jsx | ||
console.log(mount(<Bar id="2" />).debug()); | ||
``` | ||
|
||
Would output the following to the console: | ||
```jsx | ||
<Bar id="2"> | ||
<div className="bar"> | ||
<span> | ||
Non-Foo | ||
</span> | ||
<Foo baz="bax"> | ||
<div className="foo"> | ||
<span> | ||
Foo | ||
</span> | ||
</div> | ||
</Foo> | ||
</div> | ||
</Bar> | ||
``` | ||
|
||
Likewise, running: | ||
|
||
```jsx | ||
console.log(mount(<Bar id="2" />).find(Foo).debug(); | ||
``` | ||
Would output the following to the console: | ||
```jsx | ||
<Foo baz="bax"> | ||
<div className="foo"> | ||
<span> | ||
Foo | ||
</span> | ||
</div> | ||
</Foo> | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
nit: html -> HTML