From 0eec146cef868e1db0b4902f934a09f9caafe5d2 Mon Sep 17 00:00:00 2001 From: "Harish.K" Date: Sat, 2 Apr 2016 01:24:36 +0530 Subject: [PATCH] * Fancy messages * show summury message --- index-v1.js | 8 ++++---- main-runner.js | 5 ++++- 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/index-v1.js b/index-v1.js index c1ac26f..b6e9eb9 100644 --- a/index-v1.js +++ b/index-v1.js @@ -7,10 +7,10 @@ var async = require('async'); var pr = console.log; -var INDENT = ' '; +var INDENT = ' '; var STATUS_FLAG = { - true : 'Okey', - false : 'Fail' + true : '\u001b[32m\u001b[1m' + '✔' + '\u001b[22m\u001b[39m', + false : '\u001b[31m\u001b[1m' + '✗' + '\u001b[22m\u001b[39m', }; function print( level, item ){ @@ -125,7 +125,7 @@ DescribeBlock.prototype.run = function( cb ){ if( this.afterFn ){ tasks.push( this.afterFn ); } - pr( getIndent( this.level) + '---' + this.description + '---' ); + pr( getIndent( this.level) + ' ---' + this.description + '---' ); this.startTime = Date.now(); return async.waterfall( tasks, function( err ){ diff --git a/main-runner.js b/main-runner.js index 97f0323..8f82e5a 100644 --- a/main-runner.js +++ b/main-runner.js @@ -9,7 +9,10 @@ var sm = new SimpleMocha(); sm.onLoad = function(){ sm.rootDescribeBlock.run( function( err ){ - console.log( err ? 'Finished with error' : 'Finished Successfully', err ); + console.log( err ? 'Finished with error' : 'Finished Successfully' ); + if( err ){ + console.log( err.stack || err ); + } }); }