My Mocha tests were working fine, but when I added a new module (and test), mocha stopped running all of my test files and now only runs the single new test.
My test script:
env NODE_PATH=$NODE_PATH:$PWD/src mocha --recursive --compilers js:babel-core/register src/**/*.test.js --require babel-polyfill
My project is structured like this:
/src
/components
/component-name
index.js
component.js
component-name.test.js
style.scss
/util
/module-name
index.js
module-name.test.js
/some-other-module
index.js
some-other-module.test.js
I had several tests in /components
and /util
and everything worked fine, but when I place a module into /src
(like /some-other-module
) with a .test.js
file in it, Mocha only runs that test file and none of the others.
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…