我有一个应该失败的摩卡测试,但是在终端中它会相继运行两次。
describe('MySQL is functional', () => {
//Check that the heathcheck is reporting
it('indicates MySQL is running', done => {
Request.get(healthcheckUrl, (err, res, body) => {
//Decode the JSON
let json = JSON.parse(body);
assert.isOk(json.mysql === 'OK');
}).then(err => done(err));
});
});
Request.get使用Request promise库返回一个promise。
终端输出:
1) indicates MySQL is running
2) indicates MySQL is running
如果您需要更多信息,请告诉我们。