466c304128109b641e12454c5767fa997f943e8f.svn-base
882 Bytes
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
// minimal mock of the mocha Test class for formatters
module.exports = Test
function Test (result, parent) {
this.result = result
this._slow = 75
this.duration = result.time
this.title = result.name
this.state = result.ok ? 'pass' : 'failed'
this.pending = result.todo || result.skip || false
if (result.diag && result.diag.source) {
var source = result.diag.source
this.fn = {
toString: function () {
return 'function(){' + source + '\n}'
}
}
}
Object.defineProperty(this, 'parent', {
value: parent,
writable: true,
configurable: true,
enumerable: false
})
}
Test.prototype.fullTitle = function () {
return (this.parent.fullTitle() + ' ' + (this.title || '')).trim()
}
Test.prototype.slow = function (ms){
return 75
}
Test.prototype.fn = {
toString: function () {
return 'function () {\n}'
}
}