简体   繁体   English

JavaScript单元测试和持续集成2011

[英]JavaScript unit testing and continuous integration 2011

Most of the existing questions about unit testing JavaScript code and integrating it into a continuous integration environment seem to date back to the dawn of time (or at least 2008 or 2009 :) ). 关于单元测试JavaScript代码并将其集成到持续集成环境中的大多数现有问题似乎可以追溯到时间的早期(或至少2008或2009 :))。 Even a recent one is from about a year and a half ago: 即使最近的一个是大约一年半前:

Running JavaScript unit tests headlessly in a Continuous Integration build 在持续集成构建中无头地运行JavaScript单元测试

Before I launch into trying to use js-test-driver to build tests and integrate them into Jenkins (nee Hudson), is this still the best approach in 2011? 在我开始尝试使用js-test-driver构建测试并将它们集成到Jenkins(nee Hudson)之前,这仍然是2011年最好的方法吗?

We've got code that uses JavaScript and jQuery, Lawnchair, lccache, Fancybox, and more. 我们有使用JavaScript和jQuery,Lawnchair,lccache,Fancybox等的代码。 I don't think we have to test all of it, but it would be nice if we could build tests for a reasonable subset. 我认为我们不必测试所有这些,但如果我们可以为合理的子集构建测试会很好。 Bonus points if the solution is happy with backbone.js. 如果解决方案对backbone.js满意,则奖励积分。 It's looking more and more likely as time wears on. 随着时间的推移,它看起来越来越有可能。

After some further looking into this, we're going to give Jasmine BDD a try for our testing. 在进一步研究之后,我们将尝试为Jasmine BDD进行测试。 It's featured in the PeepCode videos on Backbone.js as well as this excellent article series about testing Backbone.js using Jasmine: 它在Backbone.js上的PeepCode视频以及关于使用Jasmine测试Backbone.js的优秀文章系列中有所体现:

If we go down this route it appears we may have to combine it with JsTestDriver so we can plug the whole mess into Jenkins . 如果我们沿着这条路走下去,我们可能需要将它与JsTestDriver结合起来,这样我们就可以将整个混乱插入Jenkins

您可以与Jenkins一起运行Selenium测试

作为参考以防万一有人在以后偶然发现:还有TestSwarm(由JQuery团队使用)和Buster.js(即将到来的JSTestDriver替换)

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM