@@ -8,8 +8,8 @@ var flatten = require('arr-flatten');
8
8
var figures = require ( 'figures' ) ;
9
9
var formatter = require ( './enhance-assert' ) . formatter ( ) ;
10
10
11
- function TestData ( opts ) {
12
- if ( ! ( this instanceof TestData ) ) {
11
+ function RunStatus ( opts ) {
12
+ if ( ! ( this instanceof RunStatus ) ) {
13
13
throw new TypeError ( 'Class constructor TestData cannot be invoked without \'new\'' ) ;
14
14
}
15
15
EventEmitter . call ( this ) ;
@@ -31,15 +31,15 @@ function TestData(opts) {
31
31
this . stats = [ ] ;
32
32
this . tests = [ ] ;
33
33
34
- Object . keys ( TestData . prototype ) . forEach ( function ( key ) {
34
+ Object . keys ( RunStatus . prototype ) . forEach ( function ( key ) {
35
35
this [ key ] = this [ key ] . bind ( this ) ;
36
36
} , this ) ;
37
37
}
38
38
39
- util . inherits ( TestData , EventEmitter ) ;
40
- module . exports = TestData ;
39
+ util . inherits ( RunStatus , EventEmitter ) ;
40
+ module . exports = RunStatus ;
41
41
42
- TestData . prototype . observeFork = function ( emitter ) {
42
+ RunStatus . prototype . observeFork = function ( emitter ) {
43
43
emitter
44
44
. on ( 'teardown' , this . handleTeardown )
45
45
. on ( 'stats' , this . handleStats )
@@ -61,7 +61,7 @@ function normalizeError(err) {
61
61
return err ;
62
62
}
63
63
64
- TestData . prototype . handleRejections = function ( data ) {
64
+ RunStatus . prototype . handleRejections = function ( data ) {
65
65
this . rejectionCount += data . rejections . length ;
66
66
67
67
data . rejections . forEach ( function ( err ) {
@@ -73,7 +73,7 @@ TestData.prototype.handleRejections = function (data) {
73
73
} , this ) ;
74
74
} ;
75
75
76
- TestData . prototype . handleExceptions = function ( data ) {
76
+ RunStatus . prototype . handleExceptions = function ( data ) {
77
77
this . exceptionCount ++ ;
78
78
var err = normalizeError ( data . exception ) ;
79
79
err . type = 'exception' ;
@@ -82,11 +82,11 @@ TestData.prototype.handleExceptions = function (data) {
82
82
this . errors . push ( err ) ;
83
83
} ;
84
84
85
- TestData . prototype . handleTeardown = function ( data ) {
85
+ RunStatus . prototype . handleTeardown = function ( data ) {
86
86
this . emit ( 'dependencies' , data . file , data . dependencies , this ) ;
87
87
} ;
88
88
89
- TestData . prototype . handleStats = function ( stats ) {
89
+ RunStatus . prototype . handleStats = function ( stats ) {
90
90
this . emit ( 'stats' , stats , this ) ;
91
91
92
92
if ( this . hasExclusive && ! stats . hasExclusive ) {
@@ -101,7 +101,7 @@ TestData.prototype.handleStats = function (stats) {
101
101
this . testCount += stats . testCount ;
102
102
} ;
103
103
104
- TestData . prototype . handleTest = function ( test ) {
104
+ RunStatus . prototype . handleTest = function ( test ) {
105
105
test . title = this . prefixTitle ( test . file ) + test . title ;
106
106
107
107
if ( test . error ) {
@@ -125,7 +125,7 @@ TestData.prototype.handleTest = function (test) {
125
125
this . emit ( 'test' , test , this ) ;
126
126
} ;
127
127
128
- TestData . prototype . prefixTitle = function ( file ) {
128
+ RunStatus . prototype . prefixTitle = function ( file ) {
129
129
if ( ! this . prefixTitles ) {
130
130
return '' ;
131
131
}
@@ -148,11 +148,11 @@ TestData.prototype.prefixTitle = function (file) {
148
148
return prefix ;
149
149
} ;
150
150
151
- TestData . prototype . handleOutput = function ( channel , data ) {
151
+ RunStatus . prototype . handleOutput = function ( channel , data ) {
152
152
this . emit ( channel , data , this ) ;
153
153
} ;
154
154
155
- TestData . prototype . processResults = function ( results ) {
155
+ RunStatus . prototype . processResults = function ( results ) {
156
156
// assemble stats from all tests
157
157
this . stats = results . map ( function ( result ) {
158
158
return result . stats ;
0 commit comments