mirror of
https://github.com/seejohnrun/haste-server
synced 2025-07-30 03:48:28 -07:00
Added node modules
This commit is contained in:
parent
ca9d4c18f7
commit
d1e0644a4e
575 changed files with 77900 additions and 6 deletions
61
node_modules/mocha/lib/reporters/json-stream.js
generated
vendored
Normal file
61
node_modules/mocha/lib/reporters/json-stream.js
generated
vendored
Normal file
|
@ -0,0 +1,61 @@
|
|||
|
||||
/**
|
||||
* Module dependencies.
|
||||
*/
|
||||
|
||||
var Base = require('./base')
|
||||
, color = Base.color;
|
||||
|
||||
/**
|
||||
* Expose `List`.
|
||||
*/
|
||||
|
||||
exports = module.exports = List;
|
||||
|
||||
/**
|
||||
* Initialize a new `List` test reporter.
|
||||
*
|
||||
* @param {Runner} runner
|
||||
* @api public
|
||||
*/
|
||||
|
||||
function List(runner) {
|
||||
Base.call(this, runner);
|
||||
|
||||
var self = this
|
||||
, stats = this.stats
|
||||
, total = runner.total;
|
||||
|
||||
runner.on('start', function(){
|
||||
console.log(JSON.stringify(['start', { total: total }]));
|
||||
});
|
||||
|
||||
runner.on('pass', function(test){
|
||||
console.log(JSON.stringify(['pass', clean(test)]));
|
||||
});
|
||||
|
||||
runner.on('fail', function(test, err){
|
||||
console.log(JSON.stringify(['fail', clean(test)]));
|
||||
});
|
||||
|
||||
runner.on('end', function(){
|
||||
process.stdout.write(JSON.stringify(['end', self.stats]));
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Return a plain-object representation of `test`
|
||||
* free of cyclic properties etc.
|
||||
*
|
||||
* @param {Object} test
|
||||
* @return {Object}
|
||||
* @api private
|
||||
*/
|
||||
|
||||
function clean(test) {
|
||||
return {
|
||||
title: test.title
|
||||
, fullTitle: test.fullTitle()
|
||||
, duration: test.duration
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue