[Cosmo-dev] Rough cut at a more flexible JS unit test runner
Ted Leung
twl at osafoundation.org
Thu Dec 14 15:43:43 PST 2006
On Dec 13, 2006, at 7:29 PM, Matthew Eernisse wrote:
> 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>
Ok]
>
> 2. Do we need to require dojo.widget in there?
For some reason, yes (I copied this code from
cosmoTestRunner.html). Commenting that require out yields
FATAL exception raised: symbol 'cosmo.datetime' is not defined after
loading '__package__.js'
>
> 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.
This was also copied from cosmoTestRunner.html. But I tried using
dojo.event.connect and that didn't really work either.
>
> 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.
It doesn't work in Safari, and I'm not sure why -- your :) makes me
suspect that you do....
Thanks,
Ted
More information about the cosmo-dev
mailing list