From ea03a8298f3f6e92c57c77fcbc93465e6884948f Mon Sep 17 00:00:00 2001 From: patrick Date: Mon, 12 Feb 2024 14:48:00 +0100 Subject: [PATCH 1/2] do not handle is testing --- ember_debug/main.js | 11 +++-------- tests/helpers/setup-ember-debug-test.js | 9 --------- 2 files changed, 3 insertions(+), 17 deletions(-) diff --git a/ember_debug/main.js b/ember_debug/main.js index 244638a025..6df9dce424 100644 --- a/ember_debug/main.js +++ b/ember_debug/main.js @@ -40,10 +40,7 @@ class EmberDebug extends BaseObject { * @type {String} */ get applicationId() { - if (!this.isTesting) { - return guidFor(this._application, 'ember'); - } - return guidFor(this.owner, 'ember'); + return guidFor(this._application, 'ember'); } // Using object shorthand syntax here is somehow having strange side effects. @@ -56,7 +53,7 @@ class EmberDebug extends BaseObject { this.reset($keepAdapter); return; } - if (!this._application && !this.isTesting) { + if (!this._application) { this._application = getApplication(); } this.started = true; @@ -104,9 +101,7 @@ class EmberDebug extends BaseObject { reset($keepAdapter) { setGuidPrefix(Math.random().toString()); - if (!this.isTesting && !this.owner) { - this.owner = getOwner(this._application); - } + this.owner = getOwner(this._application); this.destroyContainer(); run(() => { // Adapters don't have state depending on the application itself. diff --git a/tests/helpers/setup-ember-debug-test.js b/tests/helpers/setup-ember-debug-test.js index 090bf213d4..41146aba68 100644 --- a/tests/helpers/setup-ember-debug-test.js +++ b/tests/helpers/setup-ember-debug-test.js @@ -50,11 +50,6 @@ export default function setupEmberDebugTest(hooks, options = {}) { this.owner.register('router:main', Router); this.owner.register('service:adapter', BasicAdapter); - run(() => { - EmberDebug.isTesting = true; - EmberDebug.owner = this.owner; - }); - EmberDebug.Port = options.Port || class extends Port { @@ -73,10 +68,6 @@ export default function setupEmberDebugTest(hooks, options = {}) { EmberDebug.IGNORE_DEPRECATIONS = originalIgnoreDeprecations; - run(() => { - EmberDebug.isTesting = false; - }); - EmberDebug.Port = originalPort; setApplication(originalApp); From e4b916c95105a786daa573e7dbba6954e34bc0ab Mon Sep 17 00:00:00 2001 From: patrick Date: Mon, 12 Feb 2024 14:57:57 +0100 Subject: [PATCH 2/2] fix --- ember_debug/main.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ember_debug/main.js b/ember_debug/main.js index 6df9dce424..966b0f37e2 100644 --- a/ember_debug/main.js +++ b/ember_debug/main.js @@ -101,7 +101,7 @@ class EmberDebug extends BaseObject { reset($keepAdapter) { setGuidPrefix(Math.random().toString()); - this.owner = getOwner(this._application); + this.owner = this._application && getOwner(this._application); this.destroyContainer(); run(() => { // Adapters don't have state depending on the application itself.