Parsing beforeEach and afterEach

Tests passed
This commit is contained in:
2016-04-01 22:43:50 +05:30
parent 7617cb03bd
commit ae1b3266a4
+12 -4
View File
@@ -92,8 +92,16 @@ SimpleMocha.prototype.before = function( fn ){
SimpleMocha.prototype.after = function( fn ){ SimpleMocha.prototype.after = function( fn ){
this.currentDescribeBlock.afterFn = mkAsyncFn( fn ); this.currentDescribeBlock.afterFn = mkAsyncFn( fn );
}; };
SimpleMocha.prototype.beforeEach = function(){};
SimpleMocha.prototype.afterEach = function(){};
SimpleMocha.prototype.beforeEach = function( fn ){
this.currentDescribeBlock.beforeEachFn = mkAsyncFn( fn );
};
SimpleMocha.prototype.afterEach = function( fn ){
this.currentDescribeBlock.afterEachFn = mkAsyncFn( fn );
};
SimpleMocha.DescribeBlock = DescribeBlock; SimpleMocha.DescribeBlock = DescribeBlock;
@@ -105,8 +113,8 @@ SimpleMocha.load = function( fileName ){
var it = sm.it; var it = sm.it;
var before = sm.before; var before = sm.before;
var after = sm.after; var after = sm.after;
var beforeEach = sm.after; var beforeEach = sm.beforeEach;
var afterEach = sm.after; var afterEach = sm.afterEach;
var code = fs.readFileSync( fileName, 'utf-8' ); var code = fs.readFileSync( fileName, 'utf-8' );