source: Dev/trunk/src/client/util/doh/README @ 529

Last change on this file since 529 was 483, checked in by hendrikvanantwerpen, 11 years ago

Added Dojo 1.9.3 release.

File size: 3.5 KB
Line 
1DOH: The Dojo Object Harness
2============================
3
4DOH is a unit test framework developed by the Dojo Toolkit Community. For the tutorial published
5with the latest release see: http://dojotoolkit.org/reference-guide/util/doh.html#util-doh.
6
7DOH is a constructed as an AMD package that uses doh/main.js for its main entry point. It may
8be executed in the browser or by node.js or rhino. Typically, it is loaded by the dojo AMD
9loader; however, it is also possible to use any complying loader.
10
11
12node.js
13=======
14
15To run DOH via node.js, issue the command
16
17> node path/to/dojo/dojo.js load=doh test=path/to/test/module
18
19For example, from the util/doh/ directory you can run the self test as follows:
20
21~/dev/dojotoolkit/util/doh> node ../../dojo/dojo.js load=doh test=doh/tests/selfTest
22
23Since node.js includes executing scripts to discover their location, the dojo node bootstrap
24can discover baseUrl (the dojo directory) without further help.
25
26
27rhino
28=====
29
30To run DOH via rhino, issue the command
31
32>java -jar path/to/js.jar path/to/dojo/dojo.js baseUrl=path/to/dojo load=doh test=path/to/test/module
33
34For example, from the util/doh/ directory, you can run the self test as follows (assumes js.jar is in the user's
35home directory):
36
37~/dev/dojotoolkit/util/doh> java -jar ../shrinksafe/js.jar ../../dojo/dojo.js baseUrl=../../dojo load=doh test=doh/tests/selfTest
38
39Since rhino does not give scripts the ability to discover their location, you must do one of the following
40
41  * provide a baseUrl command line argument that specifies the dojo directory
42  * execute the command form the the dojo directory
43
44Here's the equivalent example command from the dojo directory:
45
46~/dev/dojotoolkit/dojo> java -jar ../util/shrinksafe/js.jar dojo.js load=doh test=doh/tests/selfTest
47
48
49browser
50=======
51
52To run DOH in the browser, point your browser to util/DOH/runner.html. You'll also need to provide at least one
53test module to execute by the query parameter "test". For example, to run the dojo unit tests, the URL would
54look something like...
55
56http://localhost/dev/dojotoolkit/util/doh/runner.html?test=dojo/tests/module
57
58(Of course the host and path--localhost and dev/dojotoolkit/util in the example--will depend on how you've configured
59your test environment.
60
61DOH includes the following query parameters:
62
63test:
64a comma-separated-list of AMD module identifiers that contain the tests to load.
65
66testUrl:
67deprecated alias for test
68
69paths:
70a semicolon-separated-list of comma-separated-pairs of (module-identifier -> path-prefix) to provide to the loader's
71path configuration property.
72
73registerModulePath:
74deprecated alias for paths
75
76boot:
77a comma-separated-list of Javascript resources to script inject to bootstrap DOH. Defaults to "../../dojo/dojo.js",
78which causes DOH to use the dojo AMD loader. You may use this parameter to provide and alternate loader.
79
80dojoUrl:
81deprecated alias for boot
82
83async:
84If provided, instructs the dojo loader to operate in async mode.
85
86breakOnError:
87If provided, instructs DOH to break into the debugger upon an error.
88
89
90About Hard Dojo Dependency
91==========================
92
93As of v1.7 DOH depends on dojo base via AMD define dependency lists. If this causes you concern, you
94may sandbox dojo by setting dojoConfig.scopeMap.dojo to falsy which will result in *not* publishing
95dojo to the global namespace. Alternatively, you may provide a custom library that includes the
96part of the dojo base API used by DOH and map the AMD module identifier "dojo" to this custom library.
97However, we know of no good reason to follow either of these paths.
Note: See TracBrowser for help on using the repository browser.