Skip to content

Commit 5ccec78

Browse files
prigarasindresorhus
authored andcommitted
WebStorm recipe (#1009)
1 parent c40477a commit 5ccec78

File tree

2 files changed

+22
-0
lines changed

2 files changed

+22
-0
lines changed
+21
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
# Debugging tests with WebStorm
2+
3+
Starting with version 2016.2, [WebStorm](https://www.jetbrains.com/webstorm/) and other JetBrains IDEs (IntelliJ IDEA Ultimate, PHPStorm, PyCharm Professional, and RubyMine with installed Node.js plugin) allow you to debug AVA tests.
4+
5+
6+
## Setup
7+
8+
Add a new *Node.js Run/Debug configuration*: select `Edit Configurations...` from the dropdown list on the top right, then click `+` and select *Node.js*.
9+
10+
In the `JavaScript file` field specify the path to AVA in the project's `node_modules` folder: `node_modules/.bin/ava` on macOS and Linux or `node_modules/.bin/ava.cmd` on Windows.
11+
12+
In the `Application parameters` pass the CLI flags you're using and the test files you would like to debug, for example `--verbose test.js`.
13+
14+
Save the configuration.
15+
16+
17+
## Debug
18+
19+
Set breakpoints in the code.
20+
21+
Hit the green `Debug` button next to the list of configurations on the top right. The *Debug tool window* will appear. Once the breakpoint is hit, you can evaluate variables and step through the code. When debugging multiple test files, you can switch between the processes using the dropdown in the Frames pane.

readme.md

+1
Original file line numberDiff line numberDiff line change
@@ -1019,6 +1019,7 @@ It's the [Andromeda galaxy](https://simple.wikipedia.org/wiki/Andromeda_galaxy).
10191019
- [Configuring Babel](docs/recipes/babelrc.md)
10201020
- [Testing React components](docs/recipes/react.md)
10211021
- [JSPM and SystemJS](docs/recipes/jspm-systemjs.md)
1022+
- [Debugging tests with WebStorm](docs/recipes/debugging-with-webstorm.md)
10221023

10231024
## Support
10241025

0 commit comments

Comments
 (0)