Skip to content

Commit

Permalink
Pass owner instead of registry to ember-data's setupContainer
Browse files Browse the repository at this point in the history
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.

Resolves #1386
  • Loading branch information
anehx committed May 12, 2023
1 parent 51804d7 commit 559144f
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ export default function (resolver: Resolver) {
// correctly for the tests; that's why we import and call setupContainer
// here; also see https://github.com/emberjs/data/issues/4071 for context
let setupContainer = require('ember-data/setup-container')['default'];
setupContainer(registry || container);
setupContainer(owner);
}

return {
Expand Down

0 comments on commit 559144f

Please sign in to comment.