Running jest tests directly in Intellij Idea/WebStorm?
To make Jest test results shown in a tree view (like karma, etc.), a special integration is needed. WebStorm doesn't yet support Jest. Please vote for WEB-14979 to be notified on any progress.
EDIT: as of March 2017 the first version of Jest integration at WebStorm has been released.
In WebStorm 9+ You can set this up as follows:
Install Jest CLI:
npm install --save-dev jest-cli
Create node run configuration with javascript file set to
node_modules/.bin/jest
, and application parameter to--runInBand
.runInBand
tellsjest
to run in single process, otherwise there's a port conflict when running multiple node processes in debug modeCreate some tests and run configuration in Debug mode (Ctrl-D/CMD-D). If you set breakpoints in your test or app code they should hit
It would be great though if you could click on file:line numbers
in the output to go directly to the code.
app_sciences's answer is awesome, but does not work for Windows.
For windows, you can use next configuration:
Provided configuration is taken from here