Specs without expectations should be alerted to the user
- Add console.error to the HtmlReporter when there is a spec without any expectation - Change the spec's link text and color to include a warning - Create a status for specs to label them as "empty" - console is not accessible to IE unless you have developer tools open, so protect against that by mocking console. [#59424794]
This commit is contained in:
parent
71dbffeaef
commit
1922514f2d
@@ -13,6 +13,7 @@ getJasmineRequireObj().Spec = function(j$) {
|
||||
this.expectationResultFactory = attrs.expectationResultFactory || function() { };
|
||||
this.queueRunnerFactory = attrs.queueRunnerFactory || function() {};
|
||||
this.catchingExceptions = attrs.catchingExceptions || function() { return true; };
|
||||
this.expectCalled = false;
|
||||
|
||||
if (!this.fn) {
|
||||
this.pend();
|
||||
@@ -27,6 +28,7 @@ getJasmineRequireObj().Spec = function(j$) {
|
||||
}
|
||||
|
||||
Spec.prototype.addExpectationResult = function(passed, data) {
|
||||
this.expectCalled = true;
|
||||
if (passed) {
|
||||
return;
|
||||
}
|
||||
@@ -98,6 +100,10 @@ getJasmineRequireObj().Spec = function(j$) {
|
||||
return 'pending';
|
||||
}
|
||||
|
||||
if(!this.expectCalled) {
|
||||
return 'empty';
|
||||
}
|
||||
|
||||
if (this.result.failedExpectations.length > 0) {
|
||||
return 'failed';
|
||||
} else {
|
||||
|
||||
Reference in New Issue
Block a user