当我运行grunt服务器时,我的文件编辑会被捕获,浏览器通过livereload刷新。当我运行咕噜测试时,它只运行一次并关闭。
可以通过运行
yo angular --minsafe mytest
grunt test当我在Gruntfile中更改karma.unit.singlerun = false时,grunt测试现在说正在运行一个观察者,但是没有任何文件更改似乎会触发再次运行测试。
如何获得类似linemanjs工作方式的测试的重新加载能力?
发布于 2013-08-24 17:31:46
你差点就到了!您还可以在名为autoWatch的Gruntfile中设置另一个选项,该选项监视karma.conf.js中指定的文件是否发生更改。Gruntfile中的完整条目可能如下所示:
karma: {
unit: {
configFile: 'karma.conf.js',
singleRun: true,
autoWatch: false
},
server: {
configFile: 'karma.conf.js',
singleRun: false,
autoWatch: true
}
}发布于 2014-05-08 16:16:06
我设置如下:
karma: {
unit: {
configFile: 'karma.conf.js',
singleRun: false,
autoWatch: true
}
}当我更改文件时,它不能重新运行单元测试,只能重复业力:单位输出
PhantomJS 1.9.7 (Linux) Controller: MainCtrl should attach a list of awesomeThings to the scope FAILED
Expected 3 to be 100.
PhantomJS 1.9.7 (Linux): Executed 1 of 1 (1 FAILED) ERROR (0.04 secs / 0.014 secs)找到它:我在虚拟中使用共享文件夹,并在虚拟机之外更改它,这样autoWatch就无法识别这些更改。
https://stackoverflow.com/questions/18414597
复制相似问题