Q:

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.  

A:

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)

