13 |
<div id="jscoverage-main" class="yui-b"> |
<div id="jscoverage-main" class="yui-b"> |
14 |
<h2><abbr title="Frequently Asked Questions">FAQ</abbr></h2> |
<h2><abbr title="Frequently Asked Questions">FAQ</abbr></h2> |
15 |
|
|
|
<h3>Can JSCoverage be used with <a href="http://www.jsunit.net/">JsUnit</a>?</h3> |
|
|
|
|
|
<p> |
|
|
It is necessary to run JSCoverage in <dfn>inverted mode</dfn>. You will have to |
|
|
modify JsUnit to launch JSCoverage. |
|
|
</p> |
|
|
|
|
|
<p> |
|
|
See the directory <code>doc/example-jsunit</code> for an example. It |
|
|
contains a copy of JsUnit version 2.2alpha11, with the file |
|
|
<code>jsunit/app/main-data.html</code> slightly modified to add a button |
|
|
which launches JSCoverage. It also contains a simple unit test file <code>test.html</code>. You |
|
|
can instrument this example as follows: |
|
|
</p> |
|
|
|
|
|
<pre> |
|
|
jscoverage --no-instrument=jsunit doc/example-jsunit doc/instrumented-jsunit |
|
|
</pre> |
|
|
|
|
|
<p> |
|
|
You can then run the <code>test.html</code> file in JsUnit's <code>jsunit/testRunner.html</code>. |
|
|
The simplest way to do this is probably to copy the contents of <code>doc/instrumented-jsunit</code> |
|
|
to the root of a web server and then access the URL |
|
|
</p> |
|
|
|
|
|
<pre> |
|
|
http://127.0.0.1/jsunit/testRunner.html?testPage=http://127.0.0.1/test.html&autorun=true |
|
|
</pre> |
|
|
|
|
16 |
<h3>I'm trying to load my code with the URL |
<h3>I'm trying to load my code with the URL |
17 |
<code>file:///C:/foo/bar/jscoverage.html?foo/bar.html</code> |
<code>file:///C:/foo/bar/jscoverage.html?foo/bar.html</code> |
18 |
and I'm getting all kinds of JavaScript errors.</h3> |
and I'm getting all kinds of JavaScript errors.</h3> |
44 |
</p> |
</p> |
45 |
|
|
46 |
<p> |
<p> |
47 |
See the discussion <a href="http://groups.google.com/group/Google-Web-Toolkit/browse_thread/thread/631908bd63241136/783c307480f95d8c">here</a> for more information. |
See <a href="http://groups.google.com/group/Google-Web-Toolkit/browse_thread/thread/631908bd63241136/783c307480f95d8c">this discussion</a> for more information. |
48 |
</p> |
</p> |
49 |
|
|
50 |
<h3>JSCoverage hangs sometimes when rendering the coverage report.</h3> |
<h3>JSCoverage hangs sometimes when rendering the coverage report.</h3> |
54 |
(More information <a href="http://ajaxian.com/archives/garbage-collection-in-ie6">here</a>.) |
(More information <a href="http://ajaxian.com/archives/garbage-collection-in-ie6">here</a>.) |
55 |
</p> |
</p> |
56 |
|
|
57 |
|
<h3>Can JSCoverage be used with <a href="http://www.jsunit.net/">JsUnit</a>?</h3> |
58 |
|
|
59 |
|
<p> |
60 |
|
It is necessary to run JSCoverage in <dfn>inverted mode</dfn>. You will have to |
61 |
|
modify JsUnit to launch JSCoverage. |
62 |
|
</p> |
63 |
|
|
64 |
|
<p> |
65 |
|
See the directory <code>doc/example-jsunit</code> for an example. It |
66 |
|
contains a copy of JsUnit version 2.2alpha11, with the file |
67 |
|
<code>jsunit/app/main-data.html</code> slightly modified to add a button |
68 |
|
which launches JSCoverage. It also contains a simple unit test file <code>test.html</code>. You |
69 |
|
can instrument this example as follows: |
70 |
|
</p> |
71 |
|
|
72 |
|
<pre> |
73 |
|
jscoverage --no-instrument=jsunit doc/example-jsunit doc/instrumented-jsunit |
74 |
|
</pre> |
75 |
|
|
76 |
|
<p> |
77 |
|
You can then run the <code>test.html</code> file in JsUnit's <code>jsunit/testRunner.html</code>. |
78 |
|
The simplest way to do this is probably to copy the contents of <code>doc/instrumented-jsunit</code> |
79 |
|
to the root of a web server and then access the URL |
80 |
|
</p> |
81 |
|
|
82 |
|
<pre> |
83 |
|
http://127.0.0.1/jsunit/testRunner.html?testPage=http://127.0.0.1/test.html&autorun=true |
84 |
|
</pre> |
85 |
|
|
86 |
|
<p> |
87 |
|
After the test suite has been run, click on the "Coverage report" button |
88 |
|
to get a coverage report. |
89 |
|
</p> |
90 |
|
|
91 |
</div> |
</div> |
92 |
</div> |
</div> |
93 |
<div id="jscoverage-sidebar" class="yui-b"> |
<div id="jscoverage-sidebar" class="yui-b"> |