You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: doc/test.html
+7-4
Original file line number
Diff line number
Diff line change
@@ -70,10 +70,10 @@ <h1>Unit Test</h1>
70
70
<h2>Introduction</h2>
71
71
72
72
<p>
73
-
JSX has a built-in test runner invoked by <code>--test</code> option and has a unit test framework <code>test-case.jsx</code>. The unit test framework is an xUnit style, running <code>_Test#test*():void</code> of the main file.
73
+
JSX has a built-in test runner invoked by <code>--test</code> option and has an unit test framework <code>test-case.jsx</code>. The unit test framework is an xUnit style, running <code>_Test#test*():void</code> of the given file.
74
74
</p>
75
75
<p>
76
-
Here is a basic test file, which is typically placed in <code>t/</code> of a project.
76
+
Here is a simple test file, which is typically placed in <code>t/</code> of a project.
<p>NOTE: it is recommended to use prove(1) to run tests and parse TAP, which can run test files in parallel. See .proverc and and Makefile in the <ahref="https://github.com/jsx/mizuki">mizuki</a> project.</p>
100
100
101
-
102
101
<h2>Synchronous Test</h2>
103
102
104
103
<p>Synchronous testing is really simple, where you just define test methods, which are invoked in serial.</p>
@@ -142,11 +141,15 @@ <h2>Asynchronous Test</h2>
142
141
143
142
async.done(); // to tell this test is finished
144
143
}, to);
145
-
}, 1000);
144
+
}, 1000 /* timeout in milliseconds */);
146
145
}
147
146
}
148
147
</code></pre>
149
148
149
+
<h2>Misc.</h2>
150
+
151
+
<p>jsx --test can takes test method names to run specific tests in a file. When you use <ahref="https://github.com/jsx/jsx.vim">jsx.vim</a> you can run the currently editing test method by <code>\t</code>.</p>
0 commit comments