Skip to content

Commit 2b4e35d

Browse files
suchmaskenovemberborn
authored andcommitted
Add an additional npm-based recipe for Jetbrains IDEs (#1444)
1 parent 4a769f8 commit 2b4e35d

File tree

1 file changed

+31
-1
lines changed

1 file changed

+31
-1
lines changed

docs/recipes/debugging-with-webstorm.md

Lines changed: 31 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ Translations: [Français](https://github.com/avajs/ava-docs/blob/master/fr_FR/do
55
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.
66

77

8-
## Setup
8+
## Setup using Node.js
99

1010
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*.
1111

@@ -15,6 +15,36 @@ In the `Application parameters` pass the CLI flags you're using and the test fil
1515

1616
Save the configuration.
1717

18+
## Setup using npm
19+
20+
Execute `ava --init` in your project directory to add AVA to your `package.json`.
21+
22+
Your `package.json` will look something like this:
23+
24+
```json
25+
{
26+
"name": "awesome-package",
27+
"scripts": {
28+
"test": "ava"
29+
},
30+
"devDependencies": {
31+
"ava": "^0.20.0"
32+
}
33+
}
34+
```
35+
36+
Add a new *npm Run/Debug configuration*: select `Edit Configurations...` from the dropdown list on the top right, then click `+` and select *npm*.
37+
38+
Use the following configuration parameters:
39+
40+
- `package.json`: Path to your project's `package.json` file
41+
- `Command`: `test`
42+
43+
Your IDE will then execute `npm run test` and thus call `node_modules/.bin/ava` and the AVA-configuration you have specified in your package.json.
44+
45+
Don't forget to select a Node.js interpreter.
46+
47+
Save the configuration.
1848

1949
## Debug
2050

0 commit comments

Comments
 (0)