I'm trying to use npm to run mocha tests like this:
scripts: {
test: "find ./src ./test -name *.js | xargs mocha --opts mocha.opts"
}
this works fine when I execute it straight from the CLI, but doesn't appear to execute any tests (or at least doesn't display any output from them) when I use npm run test.
FYI: I'm using xargs since mocha has no option to ignore files, and I use emacs, which generates temp files for linting in the same directory
You probably need to escape the
*.js
: