Excellent questions. While I can’t offer any step-by-step instructions, I can offer up some advice based on my own experiences.
I’ve not successfully come up with a way to automate testing, mostly due to the need to test in multiple browsers and on multiple platforms. I’m certainly open to suggestions if anyone else on the list has recommendations.
The way I’ve integrated unit testing is to trigger it using a query string argument on the site. I keep the unit testing code separate from the rest and only load it when the query string is present. That way, you don’t need to worry about having testing code on production.
As for structure, I find that keeping a separate directory for unit tests is helpful. For every JS source file you have, make sure there’s a corresponding test file in the other directory. It makes it easy to account for tests because you know if you add a JS source file, you need to add a JS test file as well.
I don’t know if there are the type of suggestions you’re looking for, but I’d be happy to provide any other insights I can.
Sent: Thursday, February 28, 2008 6:05 PM
Hey Everyone -
I was wondering if anyone has any advice on implementing the YUI
Profiler and YUI Test for a large project.
Ideally, any advice on how to perhaps use them with some automated
testing tools that a QA team might use.
Some ideas about how to organize the code, running the tests, and
removing them for a production environment would be greatly appreciated.