我是Extjs5的新手,试图用业力运行器运行茉莉花单元测试用例。虽然我成功地能够在Ext4.2应用程序中完成这个任务,但是相同的进程并不适用于Extjs5。
我看过了,但没有任何有用的链接
如果有人已经执行了Ext5应用程序,请分享代码。
任何帮助都是非常感谢的。
谢谢塔帕斯维尼
发布于 2014-12-09 23:28:19
诀窍是在开始测试之前允许正确加载所需的ExtJS类。确保在karma.conf.js中包括以下内容
// We need to add an element with the ID 'appLoadingIndicator' because [app.js].launch() is expecting it and tries to remove it
// Karma normally starts the tests right after all files specified in 'karma.config.js' have been loaded
// We only want the tests to start after Sencha Touch/ExtJS has bootstrapped the application
// 1. We temporary override the '__karma__.loaded' function
// 2. When Ext is ready we call the '__karma__.loaded' function manually
var karmaLoadedFunction = window.__karma__.loaded;
window.__karma__.loaded = function () {
};
bootstrapExtJS(); // Create this function to add anything that is not included in your class definition requires and you need to require explicitly
Ext.onReady(function () {
window.__karma__.loaded = karmaLoadedFunction;
window.__karma__.loaded();
});如果对你有用的话请告诉我。
https://stackoverflow.com/questions/26423343
复制相似问题