Show the name of the spec/suite that caused a deprecation

This commit is contained in:
Steve Gravrock
2020-09-13 12:39:42 -07:00
parent 51ad18cb28
commit e7daa429a1
8 changed files with 130 additions and 52 deletions

View File

@@ -218,17 +218,21 @@ getJasmineRequireObj().QueueRunner = function(j$) {
if (retval && j$.isFunction_(retval.then)) {
// Issue a warning that matches the user's code
if (j$.isAsyncFunction_(fn)) {
this.deprecated('An asynchronous before/it/after ' +
'function was defined with the async keyword but also took a ' +
'done callback. This is not supported and will stop working in' +
' the future. Either remove the done callback (recommended) or ' +
'remove the async keyword.');
this.deprecated(
'An asynchronous before/it/after ' +
'function was defined with the async keyword but also took a ' +
'done callback. This is not supported and will stop working in' +
' the future. Either remove the done callback (recommended) or ' +
'remove the async keyword.'
);
} else {
this.deprecated('An asynchronous before/it/after ' +
'function took a done callback but also returned a promise. ' +
'This is not supported and will stop working in the future. ' +
'Either remove the done callback (recommended) or change the ' +
'function to not return a promise.');
this.deprecated(
'An asynchronous before/it/after ' +
'function took a done callback but also returned a promise. ' +
'This is not supported and will stop working in the future. ' +
'Either remove the done callback (recommended) or change the ' +
'function to not return a promise.'
);
}
}
};