Allow reporter callbacks to be asynchronous

[finishes #154673961]
- Fixes #842

Signed-off-by: Elenore Bastian <ebastian@pivotal.io>
This commit is contained in:
Gregg Van Hove
2018-01-26 18:00:46 -08:00
parent 341c6df6ea
commit 50cd6fdd68
10 changed files with 434 additions and 272 deletions

View File

@@ -166,17 +166,20 @@ getJasmineRequireObj().TreeProcessor = function() {
if (node.children) {
return {
fn: function(done) {
nodeStart(node);
var onStart = {
fn: function(next) {
nodeStart(node, next);
}
};
queueRunnerFactory({
onComplete: function() {
onComplete: function () {
node.cleanupBeforeAfter();
nodeComplete(node, node.getResult());
done();
nodeComplete(node, node.getResult(), done);
},
queueableFns: wrapChildren(node, segmentNumber),
queueableFns: [onStart].concat(wrapChildren(node, segmentNumber)),
userContext: node.sharedUserContext(),
onException: function() {
onException: function () {
node.onException.apply(node, arguments);
}
});