From 75d79358b65e905a43fcf1cdf1c5bb380792d72b Mon Sep 17 00:00:00 2001 From: "Harish.K" Date: Fri, 1 Apr 2016 01:04:07 +0530 Subject: [PATCH] Cleanup tests --- index-v1.js | 3 ++- test/simple-mocha.spec.js | 24 ++++++++++++++++-------- 2 files changed, 18 insertions(+), 9 deletions(-) diff --git a/index-v1.js b/index-v1.js index fc5fe22..89f26e9 100644 --- a/index-v1.js +++ b/index-v1.js @@ -1,5 +1,6 @@ -var _d = console.log.bind( console, 'dbg: ' ); +// var _d = console.log.bind( console, 'dbg: ' ); +var _d = function(){}; var fs = require('fs'); function DescribeBlock( parentBlock ){ diff --git a/test/simple-mocha.spec.js b/test/simple-mocha.spec.js index edbaabd..7196831 100644 --- a/test/simple-mocha.spec.js +++ b/test/simple-mocha.spec.js @@ -7,24 +7,32 @@ var assert = require('assert'); describe( 'Simple before block + it s ', function(){ - it( 'should parse simple test file' , function( done ){ + describe( 'should parse simple test file' , function(){ var runner = SimpleMocha.load( __dirname + '/data/dummy.spec.js' ); - assert( runner ); + it( 'should load', function(){ + assert( runner ); + }) var describeBlock = runner.rootDescribeBlock; - assert( describeBlock ); - assert( describeBlock instanceof SimpleMocha.DescribeBlock ); - assert.equal( describeBlock.children.length, 1 ); + it( 'should have a root describe block', function(){ + assert( describeBlock ); + assert( describeBlock instanceof SimpleMocha.DescribeBlock ); + assert.equal( describeBlock.children.length, 1 ); + }); var firsDescribeBlock = describeBlock.children[0]; - assert( firsDescribeBlock instanceof SimpleMocha.DescribeBlock ); - assert( firsDescribeBlock.beforeFn ); + it( 'rootDescribeBlock should have child blocks', function(){ + assert( firsDescribeBlock instanceof SimpleMocha.DescribeBlock ); + }); + + it( 'child describeBlock should parse before hook', function(){ + assert( firsDescribeBlock.beforeFn ); + }); - done(); }); })