Add explicit fail function.
- Adds an expectation failure to the current spec [finishes #70975468] Fix #563
This commit is contained in:
@@ -335,6 +335,22 @@ getJasmineRequireObj().Env = function(j$) {
|
||||
this.pending = function() {
|
||||
throw j$.Spec.pendingSpecExceptionMessage;
|
||||
};
|
||||
|
||||
this.fail = function(error) {
|
||||
var message = 'Failed';
|
||||
if (error) {
|
||||
message += ': ';
|
||||
message += error.message || error;
|
||||
}
|
||||
|
||||
currentSpec.addExpectationResult(false, {
|
||||
matcherName: '',
|
||||
passed: false,
|
||||
expected: '',
|
||||
actual: '',
|
||||
message: message
|
||||
});
|
||||
};
|
||||
}
|
||||
|
||||
return Env;
|
||||
|
||||
Reference in New Issue
Block a user