[Cosmo-dev] Rough cut at a more flexible JS unit test runner

Matthew Eernisse mde at osafoundation.org
Wed Dec 13 19:29:14 PST 2006


Ted,

The test stuff looks good. I used it to hammer out some tests for 
cosmo.datetime.Date, and everything worked fine.

Here's what little feedback I have on the code.

1. The "language" attribute for script elements was deprecated in HTML 
4.01, so all you need is:

<script type="text/javascript" src="blah.js"></script>

2. Do we need to require dojo.widget in there?

3. If old-fashioned "onload=blah" event registration on the doc body was 
clobbering some other listeners set elsewhere, you might try using 
dojo.event.browser.addListener, like we use the login.jsp page:

dojo.event.browser.addListener(window, "onload", init, false);
function init() {
     cosmo.app.init();
}

Presumably dojo.event.connect would work too.

4. The DOM stuff looks good. Does it work in Safari? :) It also might 
not be a bad idea to test it at some point in IE -- although that might 
be hard since it seems like the only way to load it up right now is as a 
local file.

That's it. Like I said, it works great -- we could add a bit of 
scrolling and maybe group tests by filename at some point, but it's fine 
for now I guess. :)


Matthew


Ted Leung wrote:
> As part of bug 
> <https://bugzilla.osafoundation.org/show_bug.cgi?id=5689>, I am looking 
> at making the JS unit test runner a bit more friendly.   I've got a 
> rough version that displays all the tests in a list and lets you select 
> which ones you want to run.  It's cosmetically ugly and needs polish, 
> but I wanted to get some general feedback on it before I work on it any 
> further.   I've attached the file to this message.    It goes in the 
> same directory as the current CosmoTestRunner.html, which is 
> src/test/js/unit.
> 
> Bobby and Matthew in particular, I'd like your feedback.  Bobby because 
> you set part of the TODO's for bug 5689, and Matthew to whip my JS into 
> shape.
> 
> Thanks,
> 
> Ted
> 
> ------------------------------------------------------------------------
> 
> Run Tests
> 
> 
> ------------------------------------------------------------------------
> 
> _______________________________________________
> cosmo-dev mailing list
> cosmo-dev at lists.osafoundation.org
> http://lists.osafoundation.org/mailman/listinfo/cosmo-dev



More information about the cosmo-dev mailing list