This commit is contained in:
2015-06-17 14:09:18 +05:30
parent 29c671188b
commit e0a988709f
2 changed files with 10 additions and 2 deletions
+9 -1
View File
@@ -13,7 +13,7 @@
/* Don't do anything if we are in Mocha's environment */ /* Don't do anything if we are in Mocha's environment */
if( global.describe ){ return; } // if( global.describe ){ return; }
@@ -23,6 +23,13 @@ function padding( str, width ){
return ( ' ' + str ).slice(-width); return ( ' ' + str ).slice(-width);
} }
var printer = function(prefix){
return function(){
var args = [].slice.call(arguments);
args[0] = prefix + args[0];
console.log.apply(console, args );
};
};
function Task(name, fn, parentNode ){ function Task(name, fn, parentNode ){
@@ -72,6 +79,7 @@ Task.prototype.print = function(){
function runner( d, cb ){ function runner( d, cb ){
cb = cb||function(){}; cb = cb||function(){};
var print = printer( d.indent );
console.log(''); console.log('');
print( 'Describe: ', d.name ); print( 'Describe: ', d.name );
+1 -1
View File
@@ -1,6 +1,6 @@
{ {
"name": "simple-mocha", "name": "simple-mocha",
"version": "0.0.2", "version": "0.0.3",
"description": "Simple stupid implementation of Mocha test runner. Tests can be run directly within node as any Nodejs code.", "description": "Simple stupid implementation of Mocha test runner. Tests can be run directly within node as any Nodejs code.",
"author": "Harish.K<harish2704@gmail.com>", "author": "Harish.K<harish2704@gmail.com>",
"license": "MIT", "license": "MIT",