当我添加和删除测试时,我经常必须创建/编辑SpecRunner.html
文件。
我知道我可以使用业力运行测试服务器。但是对于开发测试,我更喜欢检查浏览器中的结果。我已经尝试使用业力,目前我会用咕unt进行测试;但是有时候我更喜欢该游戏机更适合编写测试。
是否有Yeoman发电机会在此时间为我自动生成Specrunner?
我找到了此NPM软件包:https://npmjs.org/package/atropa-jasmine-pec-runner-generator-generator-html
,但似乎并没有得到广泛的支持或通过咕unt声。
grunt-template-jasmine-requirejs是角/骨干项目的不错选择。它的目的是与Grunt-Contrib-Jasmine一起使用,但它将使用Grunt生成Spec Runner HTML文件。
在Gruntfile中指定输出
jasmine:{
template: require('grunt-template-jasmine-requirejs'),
templateOptions: {
requireConfigFile: 'src/test/js/require-unit-config.js'
},
test:{
options:{
outfile:'mySpecRunner.html'
}
}
}