Created
June 6, 2020 17:29
-
-
Save craigtaub/a975c3fd0c6817176a56dd73b2e42484 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
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