diff --git a/package.json b/package.json index c71115c376..55124c90f4 100644 --- a/package.json +++ b/package.json @@ -117,6 +117,9 @@ "webpack": "^5.51.1", "yauzl": "^2.10.0" }, + "resolutions": { + "socket.io": "4.2.0" + }, "engines": { "node": "12.* || 14.* || >= 16" }, diff --git a/tests/ember_debug/object-inspector-test.js b/tests/ember_debug/object-inspector-test.js index e7f9e99a99..d6c23b7e2c 100644 --- a/tests/ember_debug/object-inspector-test.js +++ b/tests/ember_debug/object-inspector-test.js @@ -19,6 +19,8 @@ import hasEmberVersion from '@ember/test-helpers/has-ember-version'; import { compareVersion } from 'ember-debug/utils/version'; import EmberDebug from 'ember-debug/main'; import setupEmberDebugTest from '../helpers/setup-ember-debug-test'; +import EmberRoute from '@ember/routing/route'; +import Controller from '@ember/controller'; const GlimmerComponent = (function () { try { @@ -72,9 +74,25 @@ async function inspectObject(object) { } module('Ember Debug - Object Inspector', function (hooks) { - setupEmberDebugTest(hooks); + setupEmberDebugTest(hooks, { + routes() { + this.route('simple'); + }, + }); hooks.beforeEach(async function () { + this.owner.register('route:application', EmberRoute); + + this.owner.register('controller:application', Controller); + + this.owner.register( + 'template:application', + hbs( + '
{{outlet}}
', + { moduleName: 'my-app/templates/application.hbs' } + ) + ); + this.owner.register('route:simple', EmberRoute); this.owner.register('component:x-simple', Component); this.owner.register( 'template:simple', @@ -1117,7 +1135,7 @@ module('Ember Debug - Object Inspector', function (hooks) { test('Inspecting GlimmerComponent does not cause errors', async function (assert) { let instance; - class FooComponent extends GlimmerComponent { + class Foo extends GlimmerComponent { constructor(...args) { super(...args); instance = this; @@ -1134,15 +1152,20 @@ module('Ember Debug - Object Inspector', function (hooks) { } } - this.owner.register('component:foo', FooComponent); - this.owner.register('template:simple', hbs``); + this.owner.register('template:simple', hbs``, { + moduleName: 'my-app/templates/simple.hbs', + }); + this.owner.register('component:foo', Foo); + this.owner.register( + `template:components/foo`, + hbs('text only', { + moduleName: 'my-app/templates/components/foo.hbs', + }) + ); await visit('/simple'); - assert.ok( - instance instanceof FooComponent, - 'an instance of FooComponent has been created' - ); + assert.ok(instance instanceof Foo, 'an instance of Foo has been created'); let { details, errors } = await inspectObject(instance); diff --git a/tests/helpers/setup-ember-debug-test.js b/tests/helpers/setup-ember-debug-test.js index d816b21f54..a295e4b69a 100644 --- a/tests/helpers/setup-ember-debug-test.js +++ b/tests/helpers/setup-ember-debug-test.js @@ -1,4 +1,5 @@ import Application from '@ember/application'; +import Resolver from 'ember-resolver'; import EmberRouter from '@ember/routing/router'; import { getApplication, @@ -22,7 +23,11 @@ export default function setupEmberDebugTest(hooks, options = {}) { originalApp = getApplication(); originalIgnoreDeprecations = EmberDebug.IGNORE_DEPRECATIONS; - app = Application.create(config.APP); + app = Application.create({ + ...config.APP, + modulePrefix: config.modulePrefix, + Resolver, + }); setApplication(app); await setupContext(this);