Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save craigtaub/a975c3fd0c6817176a56dd73b2e42484 to your computer and use it in GitHub Desktop.
Save craigtaub/a975c3fd0c6817176a56dd73b2e42484 to your computer and use it in GitHub Desktop.
Runner.prototype.runSuite = function (suite, fn) {
this.emit(EVENT_SUITE_BEGIN, (this.suite = suite))
function done(errSuite) {
// 6. run all afterAll hooks
self.hook(HOOK_TYPE_AFTER_ALL, () => {
self.emit(EVENT_SUITE_END, suite);
fn(errSuite);
});
}
function next() {
curr = suite.suites[i++]; // grab next suite
// 5. no suites left, done
if (!curr) done();
// 4. call suite
runSuite(curr, next);
}
// 1. run all beforeAll hooks
hook(HOOK_TYPE_BEFORE_ALL, () => {
// 2. run tests + callback once complete
runTests(suite, next)
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment