我想使用npm test
运行我的摩卡测试,问题是这些测试可能会改变其位置。
位置可能是lib/modules/somefolder/test/*-test.js
或lib/modules/somefolder/anotherfolder/test/*-test.js
当前我的测试脚本是这样的node_modules/.bin/mocha lib/modules/*/test/*-test.js --reporter spec
,但是找不到位于第二个位置的测试文件。
有什么办法可以在两个地方找到测试吗?
答案 0 :(得分:0)
您应该可以通过执行./**/*-test.js
来完成此操作。这将在与您所在目录相对的任何目录中找到名称中带有-test.js
的所有文件。