4
綜觀其他問題,無法真正找到問題的原因。我正在嘗試導入一個模塊並使用摩卡進行測試。確保完成()回調被稱爲在這個測試(摩卡,柴,興農)
import chai, {
expect
}
from 'chai';
import sinon from 'sinon';
import sinonChai from 'sinon-chai';
import System from 'systemjs';
import '../public/config.js';
chai.use(sinonChai);
describe('helperModule',() => {
let module;
before(function() {
return System.import('./public/js/helper.js')
.then((mod) => module = mod);
});
describe('Module loading', function() {
it('should load', function(){
expect(module.default).to.not.be.undefined;
});
});
});
我運行npm test
命令時出現以下錯誤。
1) helperModule "before all" hook:
Error: timeout of 2000ms exceeded. Ensure the done() callback is being
called in this test.
不確定在哪裏完成回調。如果您需要關於我正在使用的任何軟件包的任何額外信息,我將與他們一起編輯我的問題。
我現在正在收到另一個錯誤,我想我只好讓它刷新測試。任何想法與這一個?無法讀取未定義 \t評價文件的特性「的createElement」:///jspm_packages/npm/[email protected]/dist/jquery.js –
我將關閉這個問題,將其標記爲解決 –