Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

do not handle is testing #2557

Draft
wants to merge 2 commits into
base: main
Choose a base branch
from
Draft
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 3 additions & 8 deletions ember_debug/main.js
Original file line number Diff line number Diff line change
@@ -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 = this._application && getOwner(this._application);
this.destroyContainer();
run(() => {
// Adapters don't have state depending on the application itself.
9 changes: 0 additions & 9 deletions tests/helpers/setup-ember-debug-test.js
Original file line number Diff line number Diff line change
@@ -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);