我试着在一个打字稿项目上配置摩卡,但我用的是书:打字稿设计模式,第一章,我用的不是很好。
当我跑摩卡时,上面写着:
警告:找不到任何匹配模式的测试文件: out/ test / not文件找到
mocha.opts
--require ./test/mocha.js
out/test/mocha.js
require('chai').should();starter.js
describe('some feature', () => {
it('should pass', () => {
'foo'.should.not.equal('bar');
});
it('should error', () => {
(() => {
throw new Error();
}).should.throw();
}); });

发布于 2017-04-10 04:29:17
基于错误,似乎mocha试图在/out目录中寻找测试。首先,尝试从/out/test中删除mocha.opts或用src/test替换它,以查看这是否解决了路径问题。
您还可以尝试将mocha.js移动到/src/test目录中,并将mocha.opts移动到/src目录。
然后,在运行mocha时,请确保从项目的根(在本例中为src)运行。
https://stackoverflow.com/questions/43314944
复制相似问题