views:

728

answers:

4

I work for a team of ASP.net MVC and they are using Cruisecontrol, nUnit and nAnt for the automated testing and build. I am new to the group and i handle the Javascript layer and i am looking for ways to incorporate my work with my teams workflow.

Are there any possoble way to do this?

Thanks

+1  A: 

A few thoughts:

  • There is JSUnit, a unit test framework for JavaScript. I used it a 2 years ago and it was pretty good. Something better may be out there now.
  • I assume they're using source code control of some form, and that Cruise Control monitors the repository. If so, then just make sure your JavaScript is kept in the same repo, so it will trigger builds, automatic kickoff of unit tests, etc.
  • If you have portions of your JavaScript layer that can only be tested in a browser, think about using Selenium or a similar tool to create a kind of automated tests that drive the browser through various scenarios. I'm sure there is a way to kick these off from Cruise Control.
Charlie Flowers
+1  A: 

Just a couple of days ago, John Resig announced a JavaScript unit test automator he's working on called Test Swarm. It's just now going into alpha, but it might be worth watching.

Andrew Hedges
already read about this. but i need something that is available now. thanks :D
redBaks
A: 
CMS
+1  A: 

I've found JSUnit to be a pretty good unit testing tool for javascript.

You might also consider using javascript lint (link below). It's a static code analyzer (not a unit testing tool) and I've had good experiences with it in the past. It's not as thorough as some of the complied language lint tools, but it can save you from making some truly evil mistakes in javascript. You can run it from the web page or the command line, so it should wire into a build process pretty easily.

http://www.javascriptlint.com/index.htm

Andrew Burke