iwe*_*ein 10 bamboo jasmine angularjs karma-runner
在使用AngularJS构建单页应用程序时,我正在尝试在我的构建中集成Jasmine测试.
之前我使用Maven Jasmine插件做了类似的事情,但我不喜欢将我的项目包装在maven中只是为了运行Jasmine测试.以某种方式使用Karma(曾是Testacular)似乎更清晰.
我很高兴我能从shell命令运行,我的猜测是我可以从Bamboo运行命令.
我的问题:
好问题.确保testacular.conf.js配置为输出junit xml以供Bamboo使用
junitReporter = {
// will be resolved to basePath (in the same way as files/exclude patterns)
outputFile: 'test-results.xml'
};
Run Code Online (Sandbox Code Playgroud)
您可以将Testacular配置为针对许多浏览器运行,并预先配置为使用Chrome,我们选择开始使用PhantomJS进行单元测试.绅士里面已经有茉莉花了.
对于CI,我们遵循以下建议
// Continuous Integration mode
// if true, it capture browsers, run tests and exit
singleRun = true;
Run Code Online (Sandbox Code Playgroud)
如果你经常使用Ant(我们这样做),你有时只想坚持你所知道的......所以你可能想要检查ANT,Windows和NodeJS模块.运行节点模块(即testacular).
一个注意事项,如果你在Windows上运行testacular,那么npm安装的testacular在hiredis模块上失败,这似乎只是*nix友好.所以,没有它,它可以正常工作.
我们花了几个小时来证明所有这些工作.希望这可以帮助
- 担