Debugging Jest unit tests hangs

I have experienced this issue since upgrading from 2017.3 to the latest 2018.1.5.  Running a jest test seems to work as expected, but when I switch to debug the same test, it hangs.  I have simplified this down to a project with a package.json and a single test file.  See screenshots below.  I click the green arrow on line 3, then select Debug 'testing', and it hangs in the state pictured below.

Here is my package.json

And here are the configuration settings for the test process



I believe I have figured out the source of the issue, but it is appears to be a part of a larger issue... 

I had previously enabled the Registry flag


because it is the recommended fix for an issue with React-native debugging:


If I uncheck this flag, Jest will debug properly, but then my react-native debugging will still be broken.  Please advise.  Thank you!


I ran into a similar issue again today and thought I'd share my solution.  My jest tests started taking 1 minute or more before stopping on a break point.  I confirmed that the flag mentioned in the last comment was unchecked.  The solution was to

1. Quit webstorm

2. Open <project root>/.idea/workspace.xml (access via command line, or if using finder you may have to enable viewing hidden files).

3. Make a copy of that file in case you need to revert.

4. In workspace.xml, search for the <component name="XDebuggerManager"> tag.  I deleted the entire tag and its children, and saved over the file.

Upon opening your project, tests should debug a lot faster.  Guessing something in that xml got corrupted when upgrading my version of webstorm. 

Hope this helps!


Please sign in to leave a comment.