forked from mochajs/mocha
-
Notifications
You must be signed in to change notification settings - Fork 0
/
tap.html
31 lines (25 loc) · 1.37 KB
/
tap.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
<!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="TAP" class="comment"><h2>TAP()</h2><div class="description"><p>Initialize a new <code>TAP</code> reporter.</p></div><h3>Source</h3><pre><code>function TAP(runner) {
Base.call(this, runner);
var self = this
, stats = this.stats
, total = runner.total
, n = 1;
runner.on('start', function(){
console.log('%d..%d', 1, total);
});
runner.on('test end', function(){
++n;
});
runner.on('pending', function(test){
console.log('ok %d %s # SKIP -', n, title(test));
});
runner.on('pass', function(test){
console.log('ok %d %s', n, title(test));
});
runner.on('fail', function(test, err){
console.log('not ok %d %s', n, title(test));
console.log(err.stack.replace(/^/gm, ' '));
});
}</code></pre></div><div id="title" class="comment"><h2>title()</h2><div class="description"><p>Return a TAP-safe title of <code>test</code></p></div><h3>Source</h3><pre><code>function title(test) {
return test.fullTitle().replace(/#/g, '');
}</code></pre></div></div><ul id="menu"><li><a href="#TAP">TAP()</a></li><li><a href="#title">title()</a></li></ul></body></html>