From 2a2a671b6577bd0cb99024f70b2fe9127888c268 Mon Sep 17 00:00:00 2001 From: Steve Gravrock Date: Thu, 29 Jul 2021 20:15:04 -0700 Subject: [PATCH] Don't deprecate access to Suite#id and Spec#id --- lib/jasmine-core/jasmine.js | 3 ++- spec/core/EnvSpec.js | 3 +++ src/core/deprecatingSpecProxy.js | 2 +- src/core/deprecatingSuiteProxy.js | 1 + 4 files changed, 7 insertions(+), 2 deletions(-) diff --git a/lib/jasmine-core/jasmine.js b/lib/jasmine-core/jasmine.js index c35c614b..f2c44c62 100644 --- a/lib/jasmine-core/jasmine.js +++ b/lib/jasmine-core/jasmine.js @@ -3736,7 +3736,7 @@ getJasmineRequireObj().deprecatingSpecProxy = function(j$) { } function isAllowedMember(prop) { - return prop === 'description' || prop === 'getFullName'; + return prop === 'id' || prop === 'description' || prop === 'getFullName'; } function msg(member) { @@ -3800,6 +3800,7 @@ getJasmineRequireObj().deprecatingSpecProxy = function(j$) { // TODO: Remove this in the next major release. getJasmineRequireObj().deprecatingSuiteProxy = function(j$) { var allowedMembers = [ + 'id', 'children', 'description', 'parentSuite', diff --git a/spec/core/EnvSpec.js b/spec/core/EnvSpec.js index 4c1faeb3..d8151ef9 100644 --- a/spec/core/EnvSpec.js +++ b/spec/core/EnvSpec.js @@ -87,14 +87,17 @@ describe('Env', function() { }); suite = env.topSuite(); + suite.id; suite.description; suite.getFullName(); suite.children; suite.parentSuite; + suite.children[0].id; suite.children[0].description; suite.children[0].getFullName(); suite.children[0].children; + suite.children[1].id; suite.children[1].description; suite.children[1].getFullName(); suite.children[1].parentSuite; diff --git a/src/core/deprecatingSpecProxy.js b/src/core/deprecatingSpecProxy.js index c490705f..710c86c4 100644 --- a/src/core/deprecatingSpecProxy.js +++ b/src/core/deprecatingSpecProxy.js @@ -9,7 +9,7 @@ getJasmineRequireObj().deprecatingSpecProxy = function(j$) { } function isAllowedMember(prop) { - return prop === 'description' || prop === 'getFullName'; + return prop === 'id' || prop === 'description' || prop === 'getFullName'; } function msg(member) { diff --git a/src/core/deprecatingSuiteProxy.js b/src/core/deprecatingSuiteProxy.js index 10c3f314..d92aac8b 100644 --- a/src/core/deprecatingSuiteProxy.js +++ b/src/core/deprecatingSuiteProxy.js @@ -2,6 +2,7 @@ // TODO: Remove this in the next major release. getJasmineRequireObj().deprecatingSuiteProxy = function(j$) { var allowedMembers = [ + 'id', 'children', 'description', 'parentSuite',