0

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

7dr3am7
  • 755
  • 1
  • 8
  • 21

1 Answers1

3

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
  • I was running this and in the test, got the error that 'document' is not defined. Is there a way to run DOH through PhantomJS or something to mimic a browser? – streetlight Jan 29 '14 at 14:14
  • Probably not. DOH Robot needs Java applet support, which I'm guessing isn't present in PhantomJS? You may want to have a look at theintern.io, which is set to replace DOH. – Royston Shufflebotham Feb 01 '14 at 23:03