0
林试图使从Sails Documentation这个代码覆盖率功能的工作,以便从项目的根我跑伊斯坦布尔摩卡和帆使用自耕农发电机帆-REST的API
istanbul cover -x "**/config/**" _mocha -- --timeout 5000
它返回
Unable to resolve file [_mocha]
因此,思考也许是因为我使用这个发生器的东西是不同的,所以我尝试使用一个路径,当做'npm测试'时被解雇'
istanbul cover test/bootstrap.js _mocha -- --timeout 5000
,我得到
No coverage information was collected, exit without writing coverage information
…myprojectpath/test/bootstrap.js:1
import Sails from 'sails';
^^^^^^
我有一点伊斯坦布尔熟悉或摩卡咖啡,所以我在无人区是有点过现在。对于奖励积分可以有人告诉我什么
-x
在做什么?
*****编辑*****
低于因此,使用@MjZac建议作为命令行输入我能得到它运行后
npm install -g mocha
工作但是我注意到我的测试/发电机可能会更近,因为它看起来像...
import Sails from 'sails';
import config from '../config/env/test';
let sails;
before(done => {
Sails.lift(config, (error, server) => {
if (error) return done(error);
sails = server;
done();
});
});
after(done => sails.lower(done));
现在正在生产异常
import Sails from 'sails';
^^^^^^
SyntaxError: Unexpected token import
我认为这与ES6和伊斯坦布尔有关?
您的配置看起来相同,其实我的唯一的区别是文件名。 ..我的是“test/bootstrap.js” - 引导程序测试文件也是相同的,除了我把'超时'放入mocha.opts文件 - 我仍然得到t他的消息“无法解析文件[_mocha]” – maehue
你有摩卡安装吗? – MjZac
哦,我的不好,你已经更新了这个问题。 – MjZac