升級後,摩卡甚至不能運行一個簡單的測試,這裏是爲什麼我得到「錯誤:分辨率方法超標」?
const assert = require('assert');
it('should complete this test', function (done) {
return new Promise(function (resolve) {
assert.ok(true);
resolve();
})
.then(done);
});
我把這個代碼here
我瞭解,現在拋出一個異常Error: Resolution method is overspecified. Specify a callback * or * return a Promise; not both.
但如何代碼使其工作?我不明白。我有
node -v 6.9.4
mocha -v 3.2.0
如何在新的和正確的格式運行這段代碼現在?