mirror of
https://github.com/harish2704/simple-mocha.git
synced 2026-09-10 14:31:09 +00:00
mv files
This commit is contained in:
@@ -0,0 +1,25 @@
|
||||
|
||||
|
||||
var context = global;
|
||||
if( context.describe ){
|
||||
return;
|
||||
}
|
||||
var SimpleMocha = require( './index-v1' );
|
||||
var sm = new SimpleMocha();
|
||||
|
||||
sm.onLoad = function(){
|
||||
sm.rootDescribeBlock.run( function( err ){
|
||||
console.log( err ? 'Finished with error' : 'Finished Successfully' );
|
||||
if( err ){
|
||||
console.log( err.stack || err );
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
context.describe = sm.describe;
|
||||
context.it = sm.it;
|
||||
context.before = sm.before;
|
||||
context.after = sm.after;
|
||||
context.beforeEach = sm.beforeEach;
|
||||
context.afterEach = sm.afterEach;
|
||||
@@ -0,0 +1,21 @@
|
||||
|
||||
var SimpleMocha = require( './index-v1' );
|
||||
var fs = require('fs');
|
||||
|
||||
SimpleMocha.load = function( fileName ){
|
||||
var sm = new SimpleMocha();
|
||||
var describe = sm.describe;
|
||||
var it = sm.it;
|
||||
var before = sm.before;
|
||||
var after = sm.after;
|
||||
var beforeEach = sm.beforeEach;
|
||||
var afterEach = sm.afterEach;
|
||||
|
||||
var code = fs.readFileSync( fileName, 'utf-8' );
|
||||
|
||||
eval( code );
|
||||
|
||||
return sm;
|
||||
};
|
||||
|
||||
module.exports = SimpleMocha;
|
||||
Reference in New Issue
Block a user