You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm having problems with my tests using a custom resolver (because of ember-engines). The setupContainer function of ember-data v4+ removes deprecated compatibitlity code that allows using optionsForType on the application instance instead of the newer registerOptionsForType method:
@ember/test-helpers passes a faked registry object to setupContainer when using a custom resolver which does not have registerOptionsForType but only optionsForType. Shouldn't it pass the owner directly as setupContainer expects an application - not the registry?
I was able to fix the tests by passing owner to setupContainer instead of registry || container here:
The `setupContainer` function of `ember-data` expects an application
instance to be passed - in this case that is the faked owner object that
we create when using a custom resolver in tests.
This behaviour previously worked because `ember-data` supported the
usage of legacy function `optionsForType` which exists on the `registry`
object. However, they removed that legacy fallback in v4 and replaced it
with `registerOptionsForType` which does not exist on the registry but
only on the owner.
Resolvesemberjs#1386
The `setupContainer` function of `ember-data` expects an application
instance to be passed - in this case that is the faked owner object that
we create when using a custom resolver in tests.
This behaviour previously worked because `ember-data` supported the
usage of legacy function `optionsForType` which exists on the `registry`
object. However, they removed that legacy fallback in v4 and replaced it
with `registerOptionsForType` which does not exist on the registry but
only on the owner.
Resolvesemberjs#1386
Hi
I'm having problems with my tests using a custom resolver (because of
ember-engines
). ThesetupContainer
function ofember-data
v4+ removes deprecated compatibitlity code that allows usingoptionsForType
on the application instance instead of the newerregisterOptionsForType
method:https://github.com/emberjs/data/blob/7a957ddcf20c334fc6eeaf82cfa4f0dbb7795dfc/packages/-ember-data/addon/setup-container.js#L12-L39
@ember/test-helpers
passes a faked registry object tosetupContainer
when using a custom resolver which does not haveregisterOptionsForType
but onlyoptionsForType
. Shouldn't it pass the owner directly assetupContainer
expects an application - not the registry?I was able to fix the tests by passing
owner
tosetupContainer
instead ofregistry || container
here:ember-test-helpers/addon/addon-test-support/@ember/test-helpers/-internal/build-registry.ts
Line 126 in c25c599
I'd appreciate someone taking a look at this as my understanding of this addon is not enough for fixing this properly.
Please let me know if I can help in any way.
Thanks!
The text was updated successfully, but these errors were encountered: