mocha 1.8.1 → 1.8.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/History.md +6 -0
- package/bin/_mocha +9 -9
- package/component.json +1 -1
- package/lib/runner.js +10 -9
- package/lib/template.html +1 -0
- package/mocha.css +10 -0
- package/mocha.js +10 -9
- package/package.json +1 -1
package/History.md
CHANGED
package/bin/_mocha
CHANGED
|
@@ -5,6 +5,7 @@
|
|
|
5
5
|
*/
|
|
6
6
|
|
|
7
7
|
var program = require('commander')
|
|
8
|
+
, sprintf = require('util').format
|
|
8
9
|
, path = require('path')
|
|
9
10
|
, fs = require('fs')
|
|
10
11
|
, resolve = path.resolve
|
|
@@ -284,14 +285,13 @@ if (program.watch) {
|
|
|
284
285
|
process.exit();
|
|
285
286
|
});
|
|
286
287
|
|
|
287
|
-
var
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
];
|
|
288
|
+
var spinner = 'win32' == process.platform
|
|
289
|
+
? ['|','/','-','\\']
|
|
290
|
+
: ['◜','◠','◝','◞','◡','◟'];
|
|
291
|
+
|
|
292
|
+
var frames = spinner.map(function(c) {
|
|
293
|
+
return sprintf(' \u001b[96m%s \u001b[90mwatching\u001b[0m', c);
|
|
294
|
+
});
|
|
295
295
|
|
|
296
296
|
var watchFiles = utils.files(cwd);
|
|
297
297
|
|
|
@@ -415,6 +415,6 @@ function play(arr, interval) {
|
|
|
415
415
|
|
|
416
416
|
play.timer = setInterval(function(){
|
|
417
417
|
var str = arr[i++ % len];
|
|
418
|
-
process.stdout.write('\
|
|
418
|
+
process.stdout.write('\u001b[0G' + str);
|
|
419
419
|
}, interval);
|
|
420
420
|
}
|
package/component.json
CHANGED
package/lib/runner.js
CHANGED
|
@@ -9,7 +9,8 @@ var EventEmitter = require('events').EventEmitter
|
|
|
9
9
|
, utils = require('./utils')
|
|
10
10
|
, filter = utils.filter
|
|
11
11
|
, keys = utils.keys
|
|
12
|
-
, noop = function(){}
|
|
12
|
+
, noop = function(){}
|
|
13
|
+
, immediately = global.setImmediate || process.nextTick;
|
|
13
14
|
|
|
14
15
|
/**
|
|
15
16
|
* Non-enumerable globals.
|
|
@@ -185,7 +186,7 @@ Runner.prototype.fail = function(test, err){
|
|
|
185
186
|
if ('string' == typeof err) {
|
|
186
187
|
err = new Error('the string "' + err + '" was thrown, throw an Error :)');
|
|
187
188
|
}
|
|
188
|
-
|
|
189
|
+
|
|
189
190
|
this.emit('fail', test, err);
|
|
190
191
|
};
|
|
191
192
|
|
|
@@ -242,7 +243,7 @@ Runner.prototype.hook = function(name, fn){
|
|
|
242
243
|
});
|
|
243
244
|
}
|
|
244
245
|
|
|
245
|
-
|
|
246
|
+
immediately(function(){
|
|
246
247
|
next(0);
|
|
247
248
|
});
|
|
248
249
|
};
|
|
@@ -485,14 +486,16 @@ Runner.prototype.run = function(fn){
|
|
|
485
486
|
var self = this
|
|
486
487
|
, fn = fn || function(){};
|
|
487
488
|
|
|
489
|
+
function uncaught(err){
|
|
490
|
+
self.uncaught(err);
|
|
491
|
+
}
|
|
492
|
+
|
|
488
493
|
debug('start');
|
|
489
494
|
|
|
490
495
|
// callback
|
|
491
496
|
this.on('end', function(){
|
|
492
497
|
debug('end');
|
|
493
|
-
process.removeListener('uncaughtException',
|
|
494
|
-
self.uncaught(err);
|
|
495
|
-
});
|
|
498
|
+
process.removeListener('uncaughtException', uncaught);
|
|
496
499
|
fn(self.failures);
|
|
497
500
|
});
|
|
498
501
|
|
|
@@ -504,9 +507,7 @@ Runner.prototype.run = function(fn){
|
|
|
504
507
|
});
|
|
505
508
|
|
|
506
509
|
// uncaught exception
|
|
507
|
-
process.on('uncaughtException',
|
|
508
|
-
self.uncaught(err);
|
|
509
|
-
});
|
|
510
|
+
process.on('uncaughtException', uncaught);
|
|
510
511
|
|
|
511
512
|
return this;
|
|
512
513
|
};
|
package/lib/template.html
CHANGED
package/mocha.css
CHANGED
|
@@ -229,3 +229,13 @@ code .init { color: #2F6FAD }
|
|
|
229
229
|
code .string { color: #5890AD }
|
|
230
230
|
code .keyword { color: #8A6343 }
|
|
231
231
|
code .number { color: #2F6FAD }
|
|
232
|
+
|
|
233
|
+
@media screen and (max-device-width: 480px) {
|
|
234
|
+
body {
|
|
235
|
+
padding: 60px 0px;
|
|
236
|
+
}
|
|
237
|
+
|
|
238
|
+
#stats {
|
|
239
|
+
position: absolute;
|
|
240
|
+
}
|
|
241
|
+
}
|
package/mocha.js
CHANGED
|
@@ -4066,7 +4066,8 @@ var EventEmitter = require('browser/events').EventEmitter
|
|
|
4066
4066
|
, utils = require('./utils')
|
|
4067
4067
|
, filter = utils.filter
|
|
4068
4068
|
, keys = utils.keys
|
|
4069
|
-
, noop = function(){}
|
|
4069
|
+
, noop = function(){}
|
|
4070
|
+
, immediately = global.setImmediate || process.nextTick;
|
|
4070
4071
|
|
|
4071
4072
|
/**
|
|
4072
4073
|
* Non-enumerable globals.
|
|
@@ -4246,7 +4247,7 @@ Runner.prototype.fail = function(test, err){
|
|
|
4246
4247
|
if ('string' == typeof err) {
|
|
4247
4248
|
err = new Error('the string "' + err + '" was thrown, throw an Error :)');
|
|
4248
4249
|
}
|
|
4249
|
-
|
|
4250
|
+
|
|
4250
4251
|
this.emit('fail', test, err);
|
|
4251
4252
|
};
|
|
4252
4253
|
|
|
@@ -4303,7 +4304,7 @@ Runner.prototype.hook = function(name, fn){
|
|
|
4303
4304
|
});
|
|
4304
4305
|
}
|
|
4305
4306
|
|
|
4306
|
-
|
|
4307
|
+
immediately(function(){
|
|
4307
4308
|
next(0);
|
|
4308
4309
|
});
|
|
4309
4310
|
};
|
|
@@ -4546,14 +4547,16 @@ Runner.prototype.run = function(fn){
|
|
|
4546
4547
|
var self = this
|
|
4547
4548
|
, fn = fn || function(){};
|
|
4548
4549
|
|
|
4550
|
+
function uncaught(err){
|
|
4551
|
+
self.uncaught(err);
|
|
4552
|
+
}
|
|
4553
|
+
|
|
4549
4554
|
debug('start');
|
|
4550
4555
|
|
|
4551
4556
|
// callback
|
|
4552
4557
|
this.on('end', function(){
|
|
4553
4558
|
debug('end');
|
|
4554
|
-
process.removeListener('uncaughtException',
|
|
4555
|
-
self.uncaught(err);
|
|
4556
|
-
});
|
|
4559
|
+
process.removeListener('uncaughtException', uncaught);
|
|
4557
4560
|
fn(self.failures);
|
|
4558
4561
|
});
|
|
4559
4562
|
|
|
@@ -4565,9 +4568,7 @@ Runner.prototype.run = function(fn){
|
|
|
4565
4568
|
});
|
|
4566
4569
|
|
|
4567
4570
|
// uncaught exception
|
|
4568
|
-
process.on('uncaughtException',
|
|
4569
|
-
self.uncaught(err);
|
|
4570
|
-
});
|
|
4571
|
+
process.on('uncaughtException', uncaught);
|
|
4571
4572
|
|
|
4572
4573
|
return this;
|
|
4573
4574
|
};
|