Improved & unified deprecation handling

* De-duplication now happens in core, not in reporters. This ensures that
  the console doesn't get flooded.
* Stack traces are opt-out, not opt-in.
* The current runnable is not reported or logged for certain deprecations
  where it's irrelevant.
* HtmlReporter shows stack traces in expandable widgets.
* Env#deprecated and Env#deprecatedOnceWithStack are merged.
This commit is contained in:
Steve Gravrock
2021-05-24 20:38:26 -07:00
parent 61fb353197
commit 6a2a30d540
19 changed files with 1328 additions and 302 deletions

View File

@@ -35,7 +35,7 @@ getJasmineRequireObj().MatchersUtil = function(j$) {
*/
MatchersUtil.prototype.contains = function(haystack, needle, customTesters) {
if (customTesters) {
j$.getEnv().deprecatedOnceWithStack(
j$.getEnv().deprecated(
'Passing custom equality testers ' +
'to MatchersUtil#contains is deprecated. ' +
'See <https://jasmine.github.io/tutorials/upgrading_to_4.0> for details.'
@@ -172,7 +172,7 @@ getJasmineRequireObj().MatchersUtil = function(j$) {
diffBuilder = customTestersOrDiffBuilder;
} else {
if (customTestersOrDiffBuilder) {
j$.getEnv().deprecatedOnceWithStack(
j$.getEnv().deprecated(
'Passing custom equality testers ' +
'to MatchersUtil#equals is deprecated. ' +
'See <https://jasmine.github.io/tutorials/upgrading_to_4.0> for details.'
@@ -180,7 +180,7 @@ getJasmineRequireObj().MatchersUtil = function(j$) {
}
if (diffBuilderOrNothing) {
j$.getEnv().deprecatedOnceWithStack(
j$.getEnv().deprecated(
'Diff builder should be passed ' +
'as the third argument to MatchersUtil#equals, not the fourth. ' +
'See <https://jasmine.github.io/tutorials/upgrading_to_4.0> for details.'