问题描述
我一开始对AngularJS并不了解.当我运行时:
I started without knowing much in AngularJS.When I run :
.\node_modules\.bin\karma start karma.conf.js --no-auto-watch --single-run --reporters=dots --browsers=PhantomJS
我收到以下消息:
WARN [PhantomJS 1.9.8 (Windows 7 0.0.0)]: Disconnected (1 times), because no message in 10000 ms.
我从有角种子项目开始,然后根据需要进行调整.我想使用茉莉花作为我的测试框架.因此,我根据当前的角度种子制作了一个测试用例:
I started with the angular-seed project, from there I made adjustment for my needs. I want to use jasmine as my testing framework. So I made my test case based on the current angular-seed one:
describe('sputnikApp.view1 module', function () {
beforeEach(module('sputnikApp.view1'));
describe('view1 controller', function () {
var scope;
beforeEach(inject(function($rootScope, $controller) {
scope = $rootScope.$new();
$controller('View1Ctrl', {$scope: scope});
}));
it("it should have has default selected priority Normal", function() {
expect(input("select.value1").val()).toBe('2');
})
});
});
带有Expect(input(...)的部分,我认为输入的东西是jasmine框架的一部分.我添加了jasmine,显然由于未加载某些东西而出现了错误.我通过添加RequireJS进行了修复.现在我在这里,我认为差不多完成了,并且测试用例没有运行.
The part with the expect(input(... I think the input thing is part of jasmine framework. I added jasmine, and apparently I had an error because something wasn't loading. I fixed it by adding RequireJS. Now here I am, almost done I think, and the test cases aren't running.
我给您存储库和travis,这可能会有所帮助.
I give you the repository and the travis, it might help.
我怀疑这与RequireJS有关
I suspect it's something to do with RequireJS
我查看了其他与该问题有关的问题,但这是行不通的.我想我可能已经把requireJS复杂化了.如果我不需要它,那会更好...
I looked at the others questions that looks related to this one, but it doesn't work. I think I might have overcomplicated things with requireJS. If I don't need it that would be better I think...
https://github.com/Lorac/sputnik-angularjs
https://travis-ci.org/Lorac/sputnik-angularjs
推荐答案
重新构建我的依赖项+删除requireJS即可.
Rework my dependencies + removing requireJS and it works.
这篇关于10000毫秒内无消息.茉莉花因果RequireJSS的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!