我正在运行正在通过的Jasmine测试,但是在最终超时之前没有任何反应。我错过了什么?
PhantomJS 2.1.1 (Linux 0.0.0): Executed 49 of 61 SUCCESS (0 secs / 0.539 secs)
PhantomJS 2.1.1 (Linux 0.0.0): Executed 50 of 61 SUCCESS (0 secs / 0.542 secs)
PhantomJS 2.1.1 (Linux 0.0.0): Executed 51 of 61 SUCCESS (0 secs / 0.546 secs)
PhantomJS 2.1.1 (Linux 0.0.0): Executed 52 of 61 SUCCESS (0 secs / 0.549 secs)
PhantomJS 2.1.1 (Linux 0.0.0): Executed 53 of 61 SUCCESS (0 secs / 0.553 secs)
PhantomJS 2.1.1 (Linux 0.0.0): Executed 54 of 61 SUCCESS (0 secs / 0.562 secs)
PhantomJS 2.1.1 (Linux 0.0.0): Executed 55 of 61 SUCCESS (0 secs / 0.567 secs)
PhantomJS 2.1.1 (Linux 0.0.0): Executed 56 of 61 SUCCESS (0 secs / 0.573 secs)
PhantomJS 2.1.1 (Linux 0.0.0): Executed 57 of 61 SUCCESS (0 secs / 0.575 secs)
PhantomJS 2.1.1 (Linux 0.0.0): Executed 58 of 61 SUCCESS (0 secs / 0.583 secs)
PhantomJS 2.1.1 (Linux 0.0.0): Executed 59 of 61 SUCCESS (0 secs / 0.588 secs)
PhantomJS 2.1.1 (Linux 0.0.0): Executed 60 of 61 SUCCESS (0 secs / 0.593 secs)
PhantomJS 2.1.1 (Linux 0.0.0): Executed 61 of 61 SUCCESS (0 secs / 0.621 secs)
PhantomJS 2.1.1 (Linux 0.0.0): Executed 61 of 61 SUCCESS (0.446 secs / 0.621 secs)
command ((npm :test)) took more than 10 minutes since last output
答案 0 :(得分:1)
支持解决了这个问题:
node_modules / karma / bin / karma start --log-level = debug --single-run 运行单次运行会导致phantomJS干净地关闭。对于Karma来说,这显然是一种特殊的“持续集成”模式。 documentation
所以,你应该做的就是添加
singleRun:true,发送到你的karma.conf.js文件。
答案 1 :(得分:0)
// Continuous Integration mode
// if true, Karma captures browsers, runs the tests and exits
singleRun: true,
在您的karma配置文件中将 singleRun 设置为true。这将返回1或0,具体取决于测试是否通过或在结束时失败,而不是在spec文件中无限地观察更改。
答案 2 :(得分:0)
运行测试的默认值是在karma.config中处于监视模式。
如果您想以单次运行的方式运行测试,请执行以下命令:
ng test --watch false