Merge branch 'main' into 5.0

This commit is contained in:
Steve Gravrock
2022-09-18 13:39:05 -07:00
7 changed files with 227 additions and 243 deletions

View File

@@ -1825,12 +1825,12 @@ getJasmineRequireObj().Env = function(j$) {
function specStarted(spec, suite, next) { function specStarted(spec, suite, next) {
runner.currentSpec = spec; runner.currentSpec = spec;
runableResources.initForRunable(spec.id, suite.id); runableResources.initForRunable(spec.id, suite.id);
reporter.specStarted(spec.result, next); reporter.specStarted(spec.result).then(next);
} }
function reportSpecDone(spec, result, next) { function reportSpecDone(spec, result, next) {
spec.reportedDone = true; spec.reportedDone = true;
reporter.specDone(result, next); reporter.specDone(result).then(next);
} }
this.it = function(description, fn, timeout) { this.it = function(description, fn, timeout) {
@@ -7711,7 +7711,7 @@ getJasmineRequireObj().ReportDispatcher = function(j$) {
for (const method of dispatchedMethods) { for (const method of dispatchedMethods) {
this[method] = (function(m) { this[method] = (function(m) {
return function() { return function() {
dispatch(m, arguments); return dispatch(m, arguments);
}; };
})(method); })(method);
} }
@@ -7737,16 +7737,15 @@ getJasmineRequireObj().ReportDispatcher = function(j$) {
if (reporters.length === 0 && fallbackReporter !== null) { if (reporters.length === 0 && fallbackReporter !== null) {
reporters.push(fallbackReporter); reporters.push(fallbackReporter);
} }
const onComplete = args[args.length - 1];
args = Array.from(args).splice(0, args.length - 1);
const fns = []; const fns = [];
for (const reporter of reporters) { for (const reporter of reporters) {
addFn(fns, reporter, method, args); addFn(fns, reporter, method, args);
} }
return new Promise(function(resolve) {
queueRunnerFactory({ queueRunnerFactory({
queueableFns: fns, queueableFns: fns,
onComplete: onComplete, onComplete: resolve,
isReporter: true, isReporter: true,
onMultipleDone: function() { onMultipleDone: function() {
onLateError( onLateError(
@@ -7757,6 +7756,7 @@ getJasmineRequireObj().ReportDispatcher = function(j$) {
); );
} }
}); });
});
} }
function addFn(fns, reporter, method, args) { function addFn(fns, reporter, method, args) {
@@ -8407,7 +8407,6 @@ getJasmineRequireObj().Runner = function(j$) {
this.executedBefore_ = true; this.executedBefore_ = true;
this.hasFailures = false; this.hasFailures = false;
const totalSpecsDefined = this.totalSpecsDefined_();
const focusedRunables = this.focusedRunables_(); const focusedRunables = this.focusedRunables_();
const config = this.getConfig_(); const config = this.getConfig_();
@@ -8446,7 +8445,7 @@ getJasmineRequireObj().Runner = function(j$) {
nodeStart: (suite, next) => { nodeStart: (suite, next) => {
this.currentlyExecutingSuites_.push(suite); this.currentlyExecutingSuites_.push(suite);
this.runableResources_.initForRunable(suite.id, suite.parentSuite.id); this.runableResources_.initForRunable(suite.id, suite.parentSuite.id);
this.reporter_.suiteStarted(suite.result, next); this.reporter_.suiteStarted(suite.result).then(next);
suite.startTimer(); suite.startTimer();
}, },
nodeComplete: (suite, result, next) => { nodeComplete: (suite, result, next) => {
@@ -8484,11 +8483,16 @@ getJasmineRequireObj().Runner = function(j$) {
); );
} }
return this.execute2_(runablesToRun, order, processor);
}
async execute2_(runablesToRun, order, processor) {
const totalSpecsDefined = this.totalSpecsDefined_();
this.runableResources_.initForRunable(this.topSuite_.id); this.runableResources_.initForRunable(this.topSuite_.id);
const jasmineTimer = new j$.Timer(); const jasmineTimer = new j$.Timer();
jasmineTimer.start(); jasmineTimer.start();
return new Promise(resolve => {
/** /**
* Information passed to the {@link Reporter#jasmineStarted} event. * Information passed to the {@link Reporter#jasmineStarted} event.
* @typedef JasmineStartedInfo * @typedef JasmineStartedInfo
@@ -8496,16 +8500,14 @@ getJasmineRequireObj().Runner = function(j$) {
* @property {Order} order - Information about the ordering (random or not) of this execution of the suite. * @property {Order} order - Information about the ordering (random or not) of this execution of the suite.
* @since 2.0.0 * @since 2.0.0
*/ */
this.reporter_.jasmineStarted( await this.reporter_.jasmineStarted({
{
totalSpecsDefined, totalSpecsDefined,
order: order order: order
}, });
() => {
this.currentlyExecutingSuites_.push(this.topSuite_); this.currentlyExecutingSuites_.push(this.topSuite_);
await processor.execute();
processor.execute(() => {
(async () => {
if (this.topSuite_.hadBeforeAllFailure) { if (this.topSuite_.hadBeforeAllFailure) {
await this.reportChildrenOfBeforeAllFailure_(this.topSuite_); await this.reportChildrenOfBeforeAllFailure_(this.topSuite_);
} }
@@ -8519,7 +8521,7 @@ getJasmineRequireObj().Runner = function(j$) {
this.topSuite_.result.failedExpectations.length > 0 this.topSuite_.result.failedExpectations.length > 0
) { ) {
overallStatus = 'failed'; overallStatus = 'failed';
} else if (focusedRunables.length > 0) { } else if (this.focusedRunables_().length > 0) {
overallStatus = 'incomplete'; overallStatus = 'incomplete';
incompleteReason = 'fit() or fdescribe() was found'; incompleteReason = 'fit() or fdescribe() was found';
} else if (totalSpecsDefined === 0) { } else if (totalSpecsDefined === 0) {
@@ -8549,41 +8551,29 @@ getJasmineRequireObj().Runner = function(j$) {
deprecationWarnings: this.topSuite_.result.deprecationWarnings deprecationWarnings: this.topSuite_.result.deprecationWarnings
}; };
this.topSuite_.reportedDone = true; this.topSuite_.reportedDone = true;
this.reporter_.jasmineDone(jasmineDoneInfo, function() { await this.reporter_.jasmineDone(jasmineDoneInfo);
resolve(jasmineDoneInfo); return jasmineDoneInfo;
});
})();
});
}
);
});
} }
reportSuiteDone_(suite, result, next) { reportSuiteDone_(suite, result, next) {
suite.reportedDone = true; suite.reportedDone = true;
this.reporter_.suiteDone(result, next); this.reporter_.suiteDone(result).then(next);
} }
async reportChildrenOfBeforeAllFailure_(suite) { async reportChildrenOfBeforeAllFailure_(suite) {
for (const child of suite.children) { for (const child of suite.children) {
if (child instanceof j$.Suite) { if (child instanceof j$.Suite) {
await new Promise(resolve => { await this.reporter_.suiteStarted(child.result);
this.reporter_.suiteStarted(child.result, resolve);
});
await this.reportChildrenOfBeforeAllFailure_(child); await this.reportChildrenOfBeforeAllFailure_(child);
// Marking the suite passed is consistent with how suites that // Marking the suite passed is consistent with how suites that
// contain failed specs but no suite-level failures are reported. // contain failed specs but no suite-level failures are reported.
child.result.status = 'passed'; child.result.status = 'passed';
await new Promise(resolve => { await this.reporter_.suiteDone(child.result);
this.reporter_.suiteDone(child.result, resolve);
});
} else { } else {
/* a spec */ /* a spec */
await new Promise(resolve => { await this.reporter_.specStarted(child.result);
this.reporter_.specStarted(child.result, resolve);
});
child.addExpectationResult( child.addExpectationResult(
false, false,
@@ -10186,7 +10176,7 @@ getJasmineRequireObj().TreeProcessor = function() {
return stats; return stats;
}; };
this.execute = function(done) { this.execute = async function() {
if (!processed) { if (!processed) {
this.processTree(); this.processTree();
} }
@@ -10197,17 +10187,19 @@ getJasmineRequireObj().TreeProcessor = function() {
const childFns = wrapChildren(tree, 0); const childFns = wrapChildren(tree, 0);
await new Promise(function(resolve) {
queueRunnerFactory({ queueRunnerFactory({
queueableFns: childFns, queueableFns: childFns,
userContext: tree.sharedUserContext(), userContext: tree.sharedUserContext(),
onException: function() { onException: function() {
tree.handleException.apply(tree, arguments); tree.handleException.apply(tree, arguments);
}, },
onComplete: done, onComplete: resolve,
onMultipleDone: tree.onMultipleDone onMultipleDone: tree.onMultipleDone
? tree.onMultipleDone.bind(tree) ? tree.onMultipleDone.bind(tree)
: null : null
}); });
});
}; };
function runnableIndex(id) { function runnableIndex(id) {

View File

@@ -18,13 +18,12 @@ describe('ReportDispatcher', function() {
queueRunnerFactory queueRunnerFactory
), ),
reporter = jasmine.createSpyObj('reporter', ['foo', 'bar']), reporter = jasmine.createSpyObj('reporter', ['foo', 'bar']),
anotherReporter = jasmine.createSpyObj('reporter', ['foo', 'bar']), anotherReporter = jasmine.createSpyObj('reporter', ['foo', 'bar']);
completeCallback = jasmine.createSpy('complete');
dispatcher.addReporter(reporter); dispatcher.addReporter(reporter);
dispatcher.addReporter(anotherReporter); dispatcher.addReporter(anotherReporter);
dispatcher.foo(123, 456, completeCallback); dispatcher.foo(123, 456);
expect(queueRunnerFactory).toHaveBeenCalledWith( expect(queueRunnerFactory).toHaveBeenCalledWith(
jasmine.objectContaining({ jasmine.objectContaining({
@@ -47,7 +46,7 @@ describe('ReportDispatcher', function() {
queueRunnerFactory.calls.reset(); queueRunnerFactory.calls.reset();
dispatcher.bar('a', 'b', completeCallback); dispatcher.bar('a', 'b');
expect(queueRunnerFactory).toHaveBeenCalledWith( expect(queueRunnerFactory).toHaveBeenCalledWith(
jasmine.objectContaining({ jasmine.objectContaining({
@@ -91,11 +90,10 @@ describe('ReportDispatcher', function() {
['foo', 'bar'], ['foo', 'bar'],
queueRunnerFactory queueRunnerFactory
), ),
reporter = jasmine.createSpyObj('reporter', ['foo', 'bar']), reporter = jasmine.createSpyObj('reporter', ['foo', 'bar']);
completeCallback = jasmine.createSpy('complete');
dispatcher.provideFallbackReporter(reporter); dispatcher.provideFallbackReporter(reporter);
dispatcher.foo(123, 456, completeCallback); dispatcher.foo(123, 456);
expect(queueRunnerFactory).toHaveBeenCalledWith( expect(queueRunnerFactory).toHaveBeenCalledWith(
jasmine.objectContaining({ jasmine.objectContaining({
@@ -116,12 +114,11 @@ describe('ReportDispatcher', function() {
queueRunnerFactory queueRunnerFactory
), ),
reporter = jasmine.createSpyObj('reporter', ['foo', 'bar']), reporter = jasmine.createSpyObj('reporter', ['foo', 'bar']),
fallbackReporter = jasmine.createSpyObj('otherReporter', ['foo', 'bar']), fallbackReporter = jasmine.createSpyObj('otherReporter', ['foo', 'bar']);
completeCallback = jasmine.createSpy('complete');
dispatcher.provideFallbackReporter(fallbackReporter); dispatcher.provideFallbackReporter(fallbackReporter);
dispatcher.addReporter(reporter); dispatcher.addReporter(reporter);
dispatcher.foo(123, 456, completeCallback); dispatcher.foo(123, 456);
expect(queueRunnerFactory).toHaveBeenCalledWith( expect(queueRunnerFactory).toHaveBeenCalledWith(
jasmine.objectContaining({ jasmine.objectContaining({
@@ -143,11 +140,10 @@ describe('ReportDispatcher', function() {
queueRunnerFactory queueRunnerFactory
), ),
reporter1 = jasmine.createSpyObj('reporter1', ['foo', 'bar']), reporter1 = jasmine.createSpyObj('reporter1', ['foo', 'bar']),
reporter2 = jasmine.createSpyObj('reporter2', ['foo', 'bar']), reporter2 = jasmine.createSpyObj('reporter2', ['foo', 'bar']);
completeCallback = jasmine.createSpy('complete');
dispatcher.addReporter(reporter1); dispatcher.addReporter(reporter1);
dispatcher.foo(123, completeCallback); dispatcher.foo(123);
expect(queueRunnerFactory).toHaveBeenCalledWith( expect(queueRunnerFactory).toHaveBeenCalledWith(
jasmine.objectContaining({ jasmine.objectContaining({
queueableFns: [{ fn: jasmine.any(Function) }], queueableFns: [{ fn: jasmine.any(Function) }],
@@ -161,7 +157,7 @@ describe('ReportDispatcher', function() {
dispatcher.clearReporters(); dispatcher.clearReporters();
dispatcher.addReporter(reporter2); dispatcher.addReporter(reporter2);
dispatcher.bar(456, completeCallback); dispatcher.bar(456);
expect(queueRunnerFactory).toHaveBeenCalledWith( expect(queueRunnerFactory).toHaveBeenCalledWith(
jasmine.objectContaining({ jasmine.objectContaining({

View File

@@ -274,7 +274,7 @@ describe('TreeProcessor', function() {
expect(result.valid).toBe(true); expect(result.valid).toBe(true);
}); });
it('runs a single leaf', function() { it('runs a single leaf', async function() {
const leaf = new Leaf(), const leaf = new Leaf(),
node = new Node({ children: [leaf], userContext: { root: 'context' } }), node = new Node({ children: [leaf], userContext: { root: 'context' } }),
queueRunner = jasmine.createSpy('queueRunner'), queueRunner = jasmine.createSpy('queueRunner'),
@@ -282,25 +282,27 @@ describe('TreeProcessor', function() {
tree: node, tree: node,
runnableIds: [leaf.id], runnableIds: [leaf.id],
queueRunnerFactory: queueRunner queueRunnerFactory: queueRunner
}), });
treeComplete = jasmine.createSpy('treeComplete');
processor.execute(treeComplete); const promise = processor.execute();
expect(queueRunner).toHaveBeenCalledWith({ expect(queueRunner).toHaveBeenCalledWith({
onComplete: treeComplete, onComplete: jasmine.any(Function),
onException: jasmine.any(Function), onException: jasmine.any(Function),
userContext: { root: 'context' }, userContext: { root: 'context' },
queueableFns: [{ fn: jasmine.any(Function) }], queueableFns: [{ fn: jasmine.any(Function) }],
onMultipleDone: null onMultipleDone: null
}); });
queueRunner.calls.mostRecent().args[0].queueableFns[0].fn('foo'); const queueRunnerArgs = queueRunner.calls.mostRecent().args[0];
queueRunnerArgs.queueableFns[0].fn('foo');
expect(leaf.execute).toHaveBeenCalledWith(queueRunner, 'foo', false, false); expect(leaf.execute).toHaveBeenCalledWith(queueRunner, 'foo', false, false);
queueRunnerArgs.onComplete();
await expectAsync(promise).toBeResolvedTo(undefined);
}); });
it('runs a node with no children', function() { it('runs a node with no children', async function() {
const node = new Node({ userContext: { node: 'context' } }), const node = new Node({ userContext: { node: 'context' } }),
root = new Node({ children: [node], userContext: { root: 'context' } }), root = new Node({ children: [node], userContext: { root: 'context' } }),
nodeStart = jasmine.createSpy('nodeStart'), nodeStart = jasmine.createSpy('nodeStart'),
@@ -313,21 +315,20 @@ describe('TreeProcessor', function() {
nodeComplete: nodeComplete, nodeComplete: nodeComplete,
queueRunnerFactory: queueRunner queueRunnerFactory: queueRunner
}), }),
treeComplete = jasmine.createSpy('treeComplete'),
nodeDone = jasmine.createSpy('nodeDone'); nodeDone = jasmine.createSpy('nodeDone');
processor.execute(treeComplete); const promise = processor.execute();
expect(queueRunner).toHaveBeenCalledWith({ expect(queueRunner).toHaveBeenCalledWith({
onComplete: treeComplete, onComplete: jasmine.any(Function),
onException: jasmine.any(Function), onException: jasmine.any(Function),
userContext: { root: 'context' }, userContext: { root: 'context' },
queueableFns: [{ fn: jasmine.any(Function) }], queueableFns: [{ fn: jasmine.any(Function) }],
onMultipleDone: null onMultipleDone: null
}); });
queueRunner.calls.mostRecent().args[0].queueableFns[0].fn(nodeDone); const queueRunnerArgs = queueRunner.calls.mostRecent().args[0];
queueRunnerArgs.queueableFns[0].fn(nodeDone);
expect(queueRunner).toHaveBeenCalledWith({ expect(queueRunner).toHaveBeenCalledWith({
onComplete: jasmine.any(Function), onComplete: jasmine.any(Function),
onMultipleDone: null, onMultipleDone: null,
@@ -348,6 +349,9 @@ describe('TreeProcessor', function() {
{ my: 'result' }, { my: 'result' },
jasmine.any(Function) jasmine.any(Function)
); );
queueRunnerArgs.onComplete();
await expectAsync(promise).toBeResolvedTo(undefined);
}); });
it('runs a node with children', function() { it('runs a node with children', function() {

View File

@@ -683,12 +683,12 @@ getJasmineRequireObj().Env = function(j$) {
function specStarted(spec, suite, next) { function specStarted(spec, suite, next) {
runner.currentSpec = spec; runner.currentSpec = spec;
runableResources.initForRunable(spec.id, suite.id); runableResources.initForRunable(spec.id, suite.id);
reporter.specStarted(spec.result, next); reporter.specStarted(spec.result).then(next);
} }
function reportSpecDone(spec, result, next) { function reportSpecDone(spec, result, next) {
spec.reportedDone = true; spec.reportedDone = true;
reporter.specDone(result, next); reporter.specDone(result).then(next);
} }
this.it = function(description, fn, timeout) { this.it = function(description, fn, timeout) {

View File

@@ -5,7 +5,7 @@ getJasmineRequireObj().ReportDispatcher = function(j$) {
for (const method of dispatchedMethods) { for (const method of dispatchedMethods) {
this[method] = (function(m) { this[method] = (function(m) {
return function() { return function() {
dispatch(m, arguments); return dispatch(m, arguments);
}; };
})(method); })(method);
} }
@@ -31,16 +31,15 @@ getJasmineRequireObj().ReportDispatcher = function(j$) {
if (reporters.length === 0 && fallbackReporter !== null) { if (reporters.length === 0 && fallbackReporter !== null) {
reporters.push(fallbackReporter); reporters.push(fallbackReporter);
} }
const onComplete = args[args.length - 1];
args = Array.from(args).splice(0, args.length - 1);
const fns = []; const fns = [];
for (const reporter of reporters) { for (const reporter of reporters) {
addFn(fns, reporter, method, args); addFn(fns, reporter, method, args);
} }
return new Promise(function(resolve) {
queueRunnerFactory({ queueRunnerFactory({
queueableFns: fns, queueableFns: fns,
onComplete: onComplete, onComplete: resolve,
isReporter: true, isReporter: true,
onMultipleDone: function() { onMultipleDone: function() {
onLateError( onLateError(
@@ -51,6 +50,7 @@ getJasmineRequireObj().ReportDispatcher = function(j$) {
); );
} }
}); });
});
} }
function addFn(fns, reporter, method, args) { function addFn(fns, reporter, method, args) {

View File

@@ -33,7 +33,6 @@ getJasmineRequireObj().Runner = function(j$) {
this.executedBefore_ = true; this.executedBefore_ = true;
this.hasFailures = false; this.hasFailures = false;
const totalSpecsDefined = this.totalSpecsDefined_();
const focusedRunables = this.focusedRunables_(); const focusedRunables = this.focusedRunables_();
const config = this.getConfig_(); const config = this.getConfig_();
@@ -72,7 +71,7 @@ getJasmineRequireObj().Runner = function(j$) {
nodeStart: (suite, next) => { nodeStart: (suite, next) => {
this.currentlyExecutingSuites_.push(suite); this.currentlyExecutingSuites_.push(suite);
this.runableResources_.initForRunable(suite.id, suite.parentSuite.id); this.runableResources_.initForRunable(suite.id, suite.parentSuite.id);
this.reporter_.suiteStarted(suite.result, next); this.reporter_.suiteStarted(suite.result).then(next);
suite.startTimer(); suite.startTimer();
}, },
nodeComplete: (suite, result, next) => { nodeComplete: (suite, result, next) => {
@@ -110,11 +109,16 @@ getJasmineRequireObj().Runner = function(j$) {
); );
} }
return this.execute2_(runablesToRun, order, processor);
}
async execute2_(runablesToRun, order, processor) {
const totalSpecsDefined = this.totalSpecsDefined_();
this.runableResources_.initForRunable(this.topSuite_.id); this.runableResources_.initForRunable(this.topSuite_.id);
const jasmineTimer = new j$.Timer(); const jasmineTimer = new j$.Timer();
jasmineTimer.start(); jasmineTimer.start();
return new Promise(resolve => {
/** /**
* Information passed to the {@link Reporter#jasmineStarted} event. * Information passed to the {@link Reporter#jasmineStarted} event.
* @typedef JasmineStartedInfo * @typedef JasmineStartedInfo
@@ -122,16 +126,14 @@ getJasmineRequireObj().Runner = function(j$) {
* @property {Order} order - Information about the ordering (random or not) of this execution of the suite. * @property {Order} order - Information about the ordering (random or not) of this execution of the suite.
* @since 2.0.0 * @since 2.0.0
*/ */
this.reporter_.jasmineStarted( await this.reporter_.jasmineStarted({
{
totalSpecsDefined, totalSpecsDefined,
order: order order: order
}, });
() => {
this.currentlyExecutingSuites_.push(this.topSuite_); this.currentlyExecutingSuites_.push(this.topSuite_);
await processor.execute();
processor.execute(() => {
(async () => {
if (this.topSuite_.hadBeforeAllFailure) { if (this.topSuite_.hadBeforeAllFailure) {
await this.reportChildrenOfBeforeAllFailure_(this.topSuite_); await this.reportChildrenOfBeforeAllFailure_(this.topSuite_);
} }
@@ -145,7 +147,7 @@ getJasmineRequireObj().Runner = function(j$) {
this.topSuite_.result.failedExpectations.length > 0 this.topSuite_.result.failedExpectations.length > 0
) { ) {
overallStatus = 'failed'; overallStatus = 'failed';
} else if (focusedRunables.length > 0) { } else if (this.focusedRunables_().length > 0) {
overallStatus = 'incomplete'; overallStatus = 'incomplete';
incompleteReason = 'fit() or fdescribe() was found'; incompleteReason = 'fit() or fdescribe() was found';
} else if (totalSpecsDefined === 0) { } else if (totalSpecsDefined === 0) {
@@ -175,41 +177,29 @@ getJasmineRequireObj().Runner = function(j$) {
deprecationWarnings: this.topSuite_.result.deprecationWarnings deprecationWarnings: this.topSuite_.result.deprecationWarnings
}; };
this.topSuite_.reportedDone = true; this.topSuite_.reportedDone = true;
this.reporter_.jasmineDone(jasmineDoneInfo, function() { await this.reporter_.jasmineDone(jasmineDoneInfo);
resolve(jasmineDoneInfo); return jasmineDoneInfo;
});
})();
});
}
);
});
} }
reportSuiteDone_(suite, result, next) { reportSuiteDone_(suite, result, next) {
suite.reportedDone = true; suite.reportedDone = true;
this.reporter_.suiteDone(result, next); this.reporter_.suiteDone(result).then(next);
} }
async reportChildrenOfBeforeAllFailure_(suite) { async reportChildrenOfBeforeAllFailure_(suite) {
for (const child of suite.children) { for (const child of suite.children) {
if (child instanceof j$.Suite) { if (child instanceof j$.Suite) {
await new Promise(resolve => { await this.reporter_.suiteStarted(child.result);
this.reporter_.suiteStarted(child.result, resolve);
});
await this.reportChildrenOfBeforeAllFailure_(child); await this.reportChildrenOfBeforeAllFailure_(child);
// Marking the suite passed is consistent with how suites that // Marking the suite passed is consistent with how suites that
// contain failed specs but no suite-level failures are reported. // contain failed specs but no suite-level failures are reported.
child.result.status = 'passed'; child.result.status = 'passed';
await new Promise(resolve => { await this.reporter_.suiteDone(child.result);
this.reporter_.suiteDone(child.result, resolve);
});
} else { } else {
/* a spec */ /* a spec */
await new Promise(resolve => { await this.reporter_.specStarted(child.result);
this.reporter_.specStarted(child.result, resolve);
});
child.addExpectationResult( child.addExpectationResult(
false, false,

View File

@@ -27,7 +27,7 @@ getJasmineRequireObj().TreeProcessor = function() {
return stats; return stats;
}; };
this.execute = function(done) { this.execute = async function() {
if (!processed) { if (!processed) {
this.processTree(); this.processTree();
} }
@@ -38,17 +38,19 @@ getJasmineRequireObj().TreeProcessor = function() {
const childFns = wrapChildren(tree, 0); const childFns = wrapChildren(tree, 0);
await new Promise(function(resolve) {
queueRunnerFactory({ queueRunnerFactory({
queueableFns: childFns, queueableFns: childFns,
userContext: tree.sharedUserContext(), userContext: tree.sharedUserContext(),
onException: function() { onException: function() {
tree.handleException.apply(tree, arguments); tree.handleException.apply(tree, arguments);
}, },
onComplete: done, onComplete: resolve,
onMultipleDone: tree.onMultipleDone onMultipleDone: tree.onMultipleDone
? tree.onMultipleDone.bind(tree) ? tree.onMultipleDone.bind(tree)
: null : null
}); });
});
}; };
function runnableIndex(id) { function runnableIndex(id) {