Add deprecation messages for things that will change/break in 3.0

[#154746527]
This commit is contained in:
Gregg Van Hove
2018-02-05 14:01:46 -08:00
parent 24bf3489dc
commit c142490c69
8 changed files with 62 additions and 11 deletions

View File

@@ -5,7 +5,7 @@ getJasmineRequireObj().QueueRunner = function(j$) {
return function() {
if (!called) {
called = true;
fn();
fn.apply(null, arguments);
}
return null;
};
@@ -24,6 +24,7 @@ getJasmineRequireObj().QueueRunner = function(j$) {
this.fail = attrs.fail || function() {};
this.globalErrors = attrs.globalErrors || { pushListener: function() {}, popListener: function() {} };
this.completeOnFirstError = !!attrs.completeOnFirstError;
this.deprecated = attrs.deprecated;
}
QueueRunner.prototype.execute = function() {
@@ -83,9 +84,13 @@ getJasmineRequireObj().QueueRunner = function(j$) {
clearTimeout(timeoutId);
self.globalErrors.popListener(handleError);
}),
next = once(function () {
next = once(function (err) {
cleanup();
if (err instanceof Error) {
self.deprecated('done callback received an Error object. Jasmine 3.0 will treat this as a failure');
}
function runNext() {
if (self.completeOnFirstError && errored) {
self.skipToCleanup(iterativeIndex);