Suite result status added when suite is complete

- This makes it easier to detect afterAll failures, because we can
  rely only complete runnables having statuses

[#78306786 & #73741654]
This commit is contained in:
Greg Cobb
2014-09-09 11:10:30 -07:00
committed by Greg Cobb
parent 3332f93a24
commit 1290d93b6a
4 changed files with 121 additions and 91 deletions

View File

@@ -643,12 +643,14 @@ getJasmineRequireObj().Env = function(j$) {
return suite;
};
var focusedRunnables = [];
this.fdescribe = function(description, specDefinitions) {
var suite = suiteFactory(description);
suite.isFocused = true;
focusedRunnables.push(suite.id);
unfocusAncestors();
unfocusAncestor();
addSpecsToSuite(suite, specDefinitions);
return suite;
@@ -686,7 +688,7 @@ getJasmineRequireObj().Env = function(j$) {
return null;
}
function unfocusAncestors() {
function unfocusAncestor() {
var focusedAncestor = findFocusedAncestor(currentDeclarationSuite);
if (focusedAncestor) {
for (var i = 0; i < focusedRunnables.length; i++) {
@@ -755,13 +757,11 @@ getJasmineRequireObj().Env = function(j$) {
return spec;
};
var focusedRunnables = [];
this.fit = function(description, fn ){
var spec = this.it(description, fn);
focusedRunnables.push(spec.id);
unfocusAncestors();
unfocusAncestor();
return spec;
};
@@ -1877,7 +1877,6 @@ getJasmineRequireObj().Suite = function() {
this.result = {
id: this.id,
status: this.disabled ? 'disabled' : '',
description: this.description,
fullName: this.getFullName(),
failedExpectations: []
@@ -1951,6 +1950,7 @@ getJasmineRequireObj().Suite = function() {
});
function complete() {
self.result.status = self.disabled ? 'disabled' : 'finished';
self.resultCallback(self.result);
if (onComplete) {