Skip to content

Commit d05e249

Browse files
wesruvkylebuch8
andauthored
Adding docs on how to debug tests (#1257)
Co-authored-by: Kyle Buchanan <[email protected]>
1 parent 687ccd1 commit d05e249

File tree

1 file changed

+17
-0
lines changed

1 file changed

+17
-0
lines changed

docs/content/develop/step-3.md

100644100755
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -219,6 +219,23 @@ Here is the command line output:
219219

220220
Nice! All four tests are working in Chrome.
221221

222+
#### Debugging tests
223+
224+
To debug tests you can run the following command from the git root:
225+
226+
```
227+
npm test [component-name] -- -p
228+
```
229+
> Specifying a specific component is optional, but will be faster than running all tests
230+
231+
This will keep your tests running, you'll be able to visit the tests in a URL that will display in the output, e.g.:
232+
233+
> http://localhost:8081/components/@patternfly/patternfly-elements/generated-index.html?cli_browser_id=0
234+
235+
Use `debugger` in your JS in failing tests to pause JS execution and see what's going on during the execution of the code.
236+
237+
To see the current state of the DOM, test's DOM can be found in nested iframes on the page.
238+
222239
## Travis Integration
223240

224241
That's it for testing, but you can also set up continuous integration on [Travis CI](https://travis-ci.org) to run tests for every push to your repository to keep track of future updates.

0 commit comments

Comments
 (0)