Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How can I run "npm test" from webstorm file watcher

Is there a way to run npm test from a watcher in webstorm. I know I can create a run configuration from NPM but then I have to trigger it manually, but I want to run my tests on every file change.

like image 243
Andreas Köberle Avatar asked Nov 08 '15 12:11

Andreas Köberle


1 Answers

Program: path/to/node
Arguments: path/to/npm-cli.js run-script test
Working directory: <folder where your package.json is located, $ProjectFileDir$, for example>

Not sure why you need it though... I'd suggest using existing test runners instead (karma, mocha, node-unit) - WebStorm provides good integration with them, and some of them support 'auto-testing' (rerunning on spec file change)

like image 191
lena Avatar answered Oct 15 '22 13:10

lena