-
Notifications
You must be signed in to change notification settings - Fork 1.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
The Debugging with WebStorm recipe needs updating for the new debug command #2317
Comments
@novemberborn Hi!
You will be able to do debug mode by this capture. I didn't use npm Configuration but Node.js Configuration. ATTENTION:
@erikkemperman said this at #1787. I think so too.
|
No, that issue predates AVA 3.
AVA runs your test file in a child process. You don't need to debug AVA itself.
Yup. Ideally we can make this work using |
I've made this plugin. |
You'd have to set it to a high value, perhaps using the CLI, eg The approach for VSCode is to configure the port, combined with Would that work for WebStorm? |
@novemberborn Not sure how to fix that in the plugin. I don't do debugging, I let IntelliJ (and friends) handle that. I create a generic nodejs run configuration, and this supports both run and debug out of the box. Perhaps I can specify additional flags when run in debug, need to look that up. |
This configuration works perfectly for me using Webstorm 2020.1. For anyone coming across this issue having trouble using this configuration to debug typescript files, you need to add I also want to add that you can set up Webstorm to compile typescript whenever this configuration is run, by adding it as an entry in the "Before launch" section. |
@chdefrene would you be interested in doing a PR to add this to the recipe? |
hi. since AVA 3 we also have issues with debugging tests with Intellij IDEA - configuration should be similar to that for webstorm but above fix did not help because error is different: Starting inspector on 127.0.0.1:54264 failed: address already in use tried to apply the solution used in VisualStudio Code, setting port but with no success. any hints? |
This PR may contain a clue as to what needs updating: #2571 |
These runtime configurations work in Webstorm with and without the debugger. They assume the package.json and node_modules directory are located at the root of the project. TypeScript support can be enabled by following the TypeScript recipe. If these prove helpful to others, I'm happy to help move it into a PR. NodeJS configuration
<!-- .run/Test.run.xml -->
<component name="ProjectRunConfigurationManager">
<configuration default="false" name="Test" type="NodeJSConfigurationType" application-parameters="--break" path-to-js-file="$PROJECT_DIR$/node_modules/.bin/ava" working-dir="$PROJECT_DIR$">
<method v="2" />
</configuration>
</component> NPM Configuration
// abbreviated package.json
{
"scripts": {
"test": "ava"
}
} <!-- .run/Test.run.xml -->
<component name="ProjectRunConfigurationManager">
<configuration default="false" name="Test" type="js.build_tools.npm">
<package-json value="$PROJECT_DIR$/package.json" />
<command value="run" />
<scripts>
<script value="test" />
</scripts>
<arguments value="-- --break" />
<node-interpreter value="project" />
<envs />
<method v="2" />
</configuration>
</component> |
@stuft2 a PR would be most welcome! |
As of #2316, the upcoming v3 release has a built-in
debug
command. I've updated two of the existing debugging recipes but I'm not a WebStorm user, so this recipe still needs updating: https://github.com/avajs/ava/blob/master/docs/recipes/debugging-with-webstorm.mdThe text was updated successfully, but these errors were encountered: