-
-
Notifications
You must be signed in to change notification settings - Fork 4.2k
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
add test verifying that registering an unknown service raises an exception #14850
add test verifying that registering an unknown service raises an exception #14850
Conversation
}) | ||
}); | ||
|
||
throws(() => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should use expectAssertion
here (otherwise it will fail for prod builds).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this seems to be an Error, not an assertion:
ember.js/packages/container/lib/registry.js
Line 712 in aeeddf7
throw new Error(`Attempting to inject an unknown injection: '${fullName}'`); |
Should this be an assertion?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That validateInjections
method is only called from here:
ember.js/packages/container/lib/container.js
Lines 505 to 513 in 9b3d581
runInDebug(() => { | |
// Ensure that all lazy injections are valid at instantiation time | |
if (!validationCache[fullName] && typeof factory._lazyInjections === 'function') { | |
lazyInjections = factory._lazyInjections(); | |
lazyInjections = container.registry.normalizeInjectionsHash(lazyInjections); | |
container.registry.validateInjections(lazyInjections); | |
} | |
}); |
Which is inside of a runInDebug
...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
thanks
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's also called from here, which doesn't seem to be wrapped in a runInDebug
:
ember.js/packages/container/lib/container.js
Line 408 in 9b3d581
container.registry.validateInjections(injections); |
This is likely why I get test failures when using expectAssertion
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm going to wrap the validateInjections
in a runInDebug
and change the Error
to an assert
b921a70
to
1ae1255
Compare
…raises an exception
1ae1255
to
ccbc56b
Compare
@rwjblue I believe that this is ready to go (I think the failing CI is just sauce labs flakiness). I've wrapped a |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, I restarted the sauce labs job.
It's 🍏, thanks |
Hey, |
@spruce this should help you: RSSchermer/ember-multiselect-checkboxes#41 |
I submitted piceaTech/ember-rapid-forms#153 to fix at least one example scenario in ember-rapid-forms. |
This now passes, but didn't in Ember 2.10. I git bisected the test and it passes since #14360