mirror of
https://github.com/seejohnrun/haste-server
synced 2025-08-19 20:33:10 -07:00
Added node modules
This commit is contained in:
parent
ca9d4c18f7
commit
d1e0644a4e
575 changed files with 77900 additions and 6 deletions
63
node_modules/mocha/lib/reporters/tap.js
generated
vendored
Normal file
63
node_modules/mocha/lib/reporters/tap.js
generated
vendored
Normal file
|
@ -0,0 +1,63 @@
|
|||
|
||||
/**
|
||||
* Module dependencies.
|
||||
*/
|
||||
|
||||
var Base = require('./base')
|
||||
, cursor = Base.cursor
|
||||
, color = Base.color;
|
||||
|
||||
/**
|
||||
* Expose `TAP`.
|
||||
*/
|
||||
|
||||
exports = module.exports = TAP;
|
||||
|
||||
/**
|
||||
* Initialize a new `TAP` reporter.
|
||||
*
|
||||
* @param {Runner} runner
|
||||
* @api public
|
||||
*/
|
||||
|
||||
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, ' '));
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Return a TAP-safe title of `test`
|
||||
*
|
||||
* @param {Object} test
|
||||
* @return {String}
|
||||
* @api private
|
||||
*/
|
||||
|
||||
function title(test) {
|
||||
return test.fullTitle().replace(/#/g, '');
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue