Move suite execution and spec queueRunner building from TreeProcesor to Runner
This: * Sets the stage for getting suite and spec execution in one place * Greatly simplifies the interaction between Runner and TreeProcessor * Focuses TreeProcessor more on building execution trees
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
describe('Runner', function() {
|
||||
describe('TreeProcessor nodeComplete callback', function() {
|
||||
it('throws if the wrong suite is passed to nodeComplete', async function() {
|
||||
// TODO: Update and re-enable these once things stabilize
|
||||
xdescribe('TreeProcessor suiteSegmentComplete callback', function() {
|
||||
it('throws if the wrong suite is passed to suiteSegmentComplete', async function() {
|
||||
const TreeProcessor = spyTreeProcessorCtor();
|
||||
const subject = new jasmineUnderTest.Runner({
|
||||
...defaultCtorOptions(),
|
||||
@@ -16,11 +17,11 @@ describe('Runner', function() {
|
||||
parentSuite: stubSuite(),
|
||||
startTimer: () => {}
|
||||
};
|
||||
await callWithNext(treeProcessorOpts.nodeStart, [suiteToRun]);
|
||||
await callWithNext(treeProcessorOpts.suiteSegmentStart, [suiteToRun]);
|
||||
|
||||
expect(function() {
|
||||
const someOtherSuite = {};
|
||||
treeProcessorOpts.nodeComplete(someOtherSuite, {}, () => {});
|
||||
treeProcessorOpts.suiteSegmentComplete(someOtherSuite, {}, () => {});
|
||||
}).toThrowError('Tried to complete the wrong suite');
|
||||
});
|
||||
|
||||
@@ -41,8 +42,11 @@ describe('Runner', function() {
|
||||
startTimer: () => {},
|
||||
endTimer: jasmine.createSpy('suiteToRun.endTimer')
|
||||
};
|
||||
await callWithNext(treeProcessorOpts.nodeStart, [suiteToRun]);
|
||||
await callWithNext(treeProcessorOpts.nodeComplete, [suiteToRun, {}]);
|
||||
await callWithNext(treeProcessorOpts.suiteSegmentStart, [suiteToRun]);
|
||||
await callWithNext(treeProcessorOpts.suiteSegmentComplete, [
|
||||
suiteToRun,
|
||||
{}
|
||||
]);
|
||||
|
||||
expect(suiteToRun.endTimer).toHaveBeenCalled();
|
||||
});
|
||||
@@ -64,8 +68,8 @@ describe('Runner', function() {
|
||||
startTimer: () => {},
|
||||
endTimer: jasmine.createSpy('suiteToRun.endTimer')
|
||||
};
|
||||
await callWithNext(treeProcessorOpts.nodeStart, [suiteToRun]);
|
||||
await callWithNext(treeProcessorOpts.nodeComplete, [
|
||||
await callWithNext(treeProcessorOpts.suiteSegmentStart, [suiteToRun]);
|
||||
await callWithNext(treeProcessorOpts.suiteSegmentComplete, [
|
||||
suiteToRun,
|
||||
{ status: 'failed' }
|
||||
]);
|
||||
@@ -90,8 +94,8 @@ describe('Runner', function() {
|
||||
startTimer: () => {},
|
||||
endTimer: jasmine.createSpy('suiteToRun.endTimer')
|
||||
};
|
||||
await callWithNext(treeProcessorOpts.nodeStart, [suiteToRun]);
|
||||
await callWithNext(treeProcessorOpts.nodeComplete, [
|
||||
await callWithNext(treeProcessorOpts.suiteSegmentStart, [suiteToRun]);
|
||||
await callWithNext(treeProcessorOpts.suiteSegmentComplete, [
|
||||
suiteToRun,
|
||||
{ status: 'passed' }
|
||||
]);
|
||||
@@ -117,8 +121,8 @@ describe('Runner', function() {
|
||||
startTimer: () => {},
|
||||
endTimer: jasmine.createSpy('suiteToRun.endTimer')
|
||||
};
|
||||
await callWithNext(treeProcessorOpts.nodeStart, [suiteToRun]);
|
||||
await callWithNext(treeProcessorOpts.nodeComplete, [
|
||||
await callWithNext(treeProcessorOpts.suiteSegmentStart, [suiteToRun]);
|
||||
await callWithNext(treeProcessorOpts.suiteSegmentComplete, [
|
||||
suiteToRun,
|
||||
{ status: 'passed' }
|
||||
]);
|
||||
@@ -146,8 +150,8 @@ describe('Runner', function() {
|
||||
startTimer: () => {},
|
||||
endTimer: jasmine.createSpy('suiteToRun.endTimer')
|
||||
};
|
||||
await callWithNext(treeProcessorOpts.nodeStart, [suiteToRun]);
|
||||
await callWithNext(treeProcessorOpts.nodeComplete, [
|
||||
await callWithNext(treeProcessorOpts.suiteSegmentStart, [suiteToRun]);
|
||||
await callWithNext(treeProcessorOpts.suiteSegmentComplete, [
|
||||
suiteToRun,
|
||||
{ status: 'passed' }
|
||||
]);
|
||||
@@ -187,10 +191,10 @@ describe('Runner', function() {
|
||||
startTimer: () => {},
|
||||
endTimer: jasmine.createSpy('suiteToRun.endTimer')
|
||||
};
|
||||
await callWithNext(treeProcessorOpts.nodeStart, [suiteToRun]);
|
||||
await callWithNext(treeProcessorOpts.suiteSegmentStart, [suiteToRun]);
|
||||
|
||||
suiteToRun.hadBeforeAllFailure = true;
|
||||
await callWithNext(treeProcessorOpts.nodeComplete, [
|
||||
await callWithNext(treeProcessorOpts.suiteSegmentComplete, [
|
||||
suiteToRun,
|
||||
{ status: 'passed' }
|
||||
]);
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user