Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save craigtaub/b9ecf8ece8c90180dee4bdfc84f5c151 to your computer and use it in GitHub Desktop.
Save craigtaub/b9ecf8ece8c90180dee4bdfc84f5c151 to your computer and use it in GitHub Desktop.
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