Skip to content

Commit 559144f

Browse files
committed
Pass owner instead of registry to ember-data's setupContainer
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
1 parent 51804d7 commit 559144f

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

addon-test-support/@ember/test-helpers/-internal/build-registry.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,7 @@ export default function (resolver: Resolver) {
118118
// correctly for the tests; that's why we import and call setupContainer
119119
// here; also see https://github.com/emberjs/data/issues/4071 for context
120120
let setupContainer = require('ember-data/setup-container')['default'];
121-
setupContainer(registry || container);
121+
setupContainer(owner);
122122
}
123123

124124
return {

0 commit comments

Comments
 (0)