1
我在放模塊測試編輯,我有這在我的spec文件:錯誤:未知類型:typeaheadjs而從咕嚕茉莉運行:覆蓋
if (typeof module !== 'undefined' && module.exports) {
var jsdom = require('jsdom').jsdom;
global.document = jsdom('<html></html>', {});
global.window = document.defaultView;
global.jQuery = global.$ = global.window.jQuery = require('jquery');
global.navigator = {
userAgent: ''
};
$.platform = $.platform || {};
require('../runtime/platform/js/modules/platform.editInPlace.js');
require('../runtime/platform/js/modules/platform.formSupport.js');
require('../runtime/vendor/parsleyjs/2.2.0-rc1/dist/parsley.js');
require('../runtime/vendor/bootstrap/3.1.1/js/bootstrap.js');
require('../runtime/vendor/x-editable/1.5.1/bootstrap3-editable/js/bootstrap-editable.js');
require('../runtime/vendor/typeaheadjs/0.9.3/typeahead.js');
require('../runtime/vendor/x-editable/1.5.1/inputs-ext/typeaheadjs/typeaheadjs.js');
require('../runtime/platform/js/modules/platform.utility.js');
}
當我跑步時咕嚕測試
:覆蓋(使用instanbul)它拋出異常(當我正在初始化編輯類型typaheadjs)。
encountered a declaration exception......×
Error: Unknown type: typeaheadjs in file:///C:/Launchpad/synergy/src/main/resources/runtime/vendor/jquery/2.1.4/jquery.js (line 250) (1)
(線250是拋出異常,並指定信息誤差函數)
,但它工作得很好,當我打電話從節點該規範時,我添加以下代碼:
function describe(str, callback) {
callback();
}
function it(str, callback) {
callback();
}
function expect() {
return {toEqual: function() {}};
}
任何線索爲什麼我從咕嚕聲中運行茉莉花時出現這個錯誤?
編輯:
我已經包含在這兩個預輸入文件,只有第一個顯示出來,當我從繁重的運行,它同時顯示,當我從節點上運行的console.log。