Dojo DOH unit testing

853 views Asked by At

I am a novice to Dojo, and I wrote a few unit tests following the normal convention and structure. I also have written tests for widgets.

I tried to run the tests using the same command I use for the unit tests:

java -jar path/to/js.jar path/to/dojo/dojo.js baseUrl=path/to/dojo load=doh test=path/to/test/module

The output says that there are no tests.

0 tests to run in 0 groups

My question is:

Is it possible to run the tests for widgets in command line? Thank you all for your time

1

There are 1 answers

2
Royston Shufflebotham On

I'm not sure why you get a report saying "0 tests ... in 0 groups" - that implies that your tests couldn't be found rather than that they failed to run.

It is possible to run some limited tests for widgets from a command line, but you'll find various problems with that:

  • if you want to use DOH Robot to run low-level automation, you'll find that that won't work, as it needs a browser 'window' object. Try executing node dojo\dojo.js load=doh test=dijit\tests\module.js (or your js.jar instead of node) from the root of your Dojo SDK directory: you'll get lots of complaints about window not existing or that registerUrl hasn't been declared
  • even if you could get that working, you'll be running tests with your particular implementation of JavaScript (and maybe some faked up implementation of some bits of a browser) and that won't be able to give you much confidence that your code will survive contact with a real browser with all its bizarreness