From e0a988709f4522470243afd9642e302b63fc3192 Mon Sep 17 00:00:00 2001 From: "Harish.K" Date: Wed, 17 Jun 2015 14:09:18 +0530 Subject: [PATCH] Fixes: --- index.js | 10 +++++++++- package.json | 2 +- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/index.js b/index.js index be5f6e3..dffd480 100644 --- a/index.js +++ b/index.js @@ -13,7 +13,7 @@ /* 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); } +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 ){ @@ -72,6 +79,7 @@ Task.prototype.print = function(){ function runner( d, cb ){ cb = cb||function(){}; + var print = printer( d.indent ); console.log(''); print( 'Describe: ', d.name ); diff --git a/package.json b/package.json index 0548303..23c88ed 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "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.", "author": "Harish.K", "license": "MIT",