forked from mochajs/mocha
-
Notifications
You must be signed in to change notification settings - Fork 0
/
qunit.html
41 lines (35 loc) · 2.98 KB
/
qunit.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
<!DOCTYPE html><html><head><title>Mocha - API documentation</title><meta http-equiv="Content-Type" content="text/html; charset=utf-8"><link rel="stylesheet" href="style.css"><script src="jquery.js"></script><script src="docs.js"></script></head><body><div id="content"><h1>Mocha</h1><div id="module.exports" class="comment"><h2>module.exports()</h2><div class="description"><p>QUnit-style interface:</p>
<pre><code>suite('Array');
test('#length', function(){
var arr = [1,2,3];
ok(arr.length == 3);
});
test('#indexOf()', function(){
var arr = [1,2,3];
ok(arr.indexOf(1) == 0);
ok(arr.indexOf(2) == 1);
ok(arr.indexOf(3) == 2);
});
suite('String');
test('#length', function(){
ok('foo'.length == 3);
});
</code></pre></div><h3>Source</h3><pre><code>module.exports = function(suite){
var suites = [suite];
suite.on('pre-require', function(context){</code></pre></div><div id="context.before" class="comment"><h2>context.before()</h2><div class="description"><p>Execute before running tests.</p></div><h3>Source</h3><pre><code>context.before = function(fn){
suites[0].beforeAll(fn);
};</code></pre></div><div id="context.after" class="comment"><h2>context.after()</h2><div class="description"><p>Execute after running tests.</p></div><h3>Source</h3><pre><code>context.after = function(fn){
suites[0].afterAll(fn);
};</code></pre></div><div id="context.beforeEach" class="comment"><h2>context.beforeEach()</h2><div class="description"><p>Execute before each test case.</p></div><h3>Source</h3><pre><code>context.beforeEach = function(fn){
suites[0].beforeEach(fn);
};</code></pre></div><div id="context.afterEach" class="comment"><h2>context.afterEach()</h2><div class="description"><p>Execute after each test case.</p></div><h3>Source</h3><pre><code>context.afterEach = function(fn){
suites[0].afterEach(fn);
};</code></pre></div><div id="context.suite" class="comment"><h2>context.suite()</h2><div class="description"><p>Describe a "suite" with the given <code>title</code>.</p></div><h3>Source</h3><pre><code>context.suite = function(title){
if (suites.length > 1) suites.shift();
var suite = Suite.create(suites[0], title);
suites.unshift(suite);
};</code></pre></div><div id="context.test" class="comment"><h2>context.test()</h2><div class="description"><p>Describe a specification or test-case<br />with the given <code>title</code> and callback <code>fn</code><br />acting as a thunk.</p></div><h3>Source</h3><pre><code>context.test = function(title, fn){
suites[0].addTest(new Test(title, fn));
};
});
};</code></pre></div></div><ul id="menu"><li><a href="#module.exports">module.exports()</a></li><li><a href="#context.before">context.before()</a></li><li><a href="#context.after">context.after()</a></li><li><a href="#context.beforeEach">context.beforeEach()</a></li><li><a href="#context.afterEach">context.afterEach()</a></li><li><a href="#context.suite">context.suite()</a></li><li><a href="#context.test">context.test()</a></li></ul></body></html>