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

fixed all the beta build test failures #1750

Merged
merged 3 commits into from
Oct 17, 2021
Merged
Show file tree
Hide file tree
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
3 changes: 3 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,9 @@
"webpack": "^5.51.1",
"yauzl": "^2.10.0"
},
"resolutions": {
"socket.io": "4.2.0"
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

},
"engines": {
"node": "12.* || 14.* || >= 16"
},
Expand Down
39 changes: 31 additions & 8 deletions tests/ember_debug/object-inspector-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down Expand Up @@ -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(
'<div class="application" style="line-height: normal;">{{outlet}}</div>',
{ moduleName: 'my-app/templates/application.hbs' }
)
);
this.owner.register('route:simple', EmberRoute);
this.owner.register('component:x-simple', Component);
this.owner.register(
'template:simple',
Expand Down Expand Up @@ -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;
Expand All @@ -1134,15 +1152,20 @@ module('Ember Debug - Object Inspector', function (hooks) {
}
}

this.owner.register('component:foo', FooComponent);
this.owner.register('template:simple', hbs`<Foo />`);
this.owner.register('template:simple', hbs`<Foo />`, {
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);

Expand Down
7 changes: 6 additions & 1 deletion tests/helpers/setup-ember-debug-test.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import Application from '@ember/application';
import Resolver from 'ember-resolver';
import EmberRouter from '@ember/routing/router';
import {
getApplication,
Expand All @@ -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,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
modulePrefix: config.modulePrefix,

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@chancancode
We do need to have modulePrefix
Otherwise, there is error
Error: Assertion Failed: modulePrefix must be defined
Seems that podModulePrefix is optional. I will leave it off.

Resolver,
});
setApplication(app);
chancancode marked this conversation as resolved.
Show resolved Hide resolved
chancancode marked this conversation as resolved.
Show resolved Hide resolved

await setupContext(this);
Expand Down