mirror of
https://github.com/harish2704/simple-mocha.git
synced 2026-09-10 06:21:08 +00:00
Cleanup tests
This commit is contained in:
+2
-1
@@ -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');
|
var fs = require('fs');
|
||||||
|
|
||||||
function DescribeBlock( parentBlock ){
|
function DescribeBlock( parentBlock ){
|
||||||
|
|||||||
@@ -7,24 +7,32 @@ var assert = require('assert');
|
|||||||
|
|
||||||
describe( 'Simple before block + it s ', function(){
|
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' );
|
var runner = SimpleMocha.load( __dirname + '/data/dummy.spec.js' );
|
||||||
|
|
||||||
assert( runner );
|
it( 'should load', function(){
|
||||||
|
assert( runner );
|
||||||
|
})
|
||||||
|
|
||||||
var describeBlock = runner.rootDescribeBlock;
|
var describeBlock = runner.rootDescribeBlock;
|
||||||
|
|
||||||
assert( describeBlock );
|
it( 'should have a root describe block', function(){
|
||||||
assert( describeBlock instanceof SimpleMocha.DescribeBlock );
|
assert( describeBlock );
|
||||||
assert.equal( describeBlock.children.length, 1 );
|
assert( describeBlock instanceof SimpleMocha.DescribeBlock );
|
||||||
|
assert.equal( describeBlock.children.length, 1 );
|
||||||
|
});
|
||||||
|
|
||||||
var firsDescribeBlock = describeBlock.children[0];
|
var firsDescribeBlock = describeBlock.children[0];
|
||||||
|
|
||||||
|
|
||||||
assert( firsDescribeBlock instanceof SimpleMocha.DescribeBlock );
|
it( 'rootDescribeBlock should have child blocks', function(){
|
||||||
assert( firsDescribeBlock.beforeFn );
|
assert( firsDescribeBlock instanceof SimpleMocha.DescribeBlock );
|
||||||
|
});
|
||||||
|
|
||||||
|
it( 'child describeBlock should parse before hook', function(){
|
||||||
|
assert( firsDescribeBlock.beforeFn );
|
||||||
|
});
|
||||||
|
|
||||||
done();
|
|
||||||
});
|
});
|
||||||
})
|
})
|
||||||
|
|||||||
Reference in New Issue
Block a user