Created
May 26, 2020 10:57
-
-
Save craigtaub/b9ecf8ece8c90180dee4bdfc84f5c151 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
bdd: function bddInterface(suite) { | |
var suites = [suite]; | |
suite.on(Suite.constants.EVENT_FILE_PRE_REQUIRE, function ( | |
context, | |
file, | |
mocha | |
) { | |
var common = Mocha.interfaces.common(suites, context, mocha); | |
context.before = common.before; | |
context.after = common.after; | |
context.beforeEach = common.beforeEach; | |
context.afterEach = common.afterEach; | |
context.describe = function (title, fn) { | |
return common.suite.create({ | |
title: title, | |
file: file, | |
fn: fn, | |
}); | |
}; | |
context.it = function (title, fn) { | |
var suite = suites[0]; | |
var test = new Test(title, fn); | |
test.file = file; | |
suite.addTest(test); | |
return test; | |
}; | |
}); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment