From 559144fe4afd53c7bee4191eaf77cd64c9cc05cd Mon Sep 17 00:00:00 2001 From: Jonas Metzener Date: Fri, 12 May 2023 09:26:24 +0200 Subject: [PATCH] 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 --- .../@ember/test-helpers/-internal/build-registry.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addon-test-support/@ember/test-helpers/-internal/build-registry.ts b/addon-test-support/@ember/test-helpers/-internal/build-registry.ts index 45777ccfe..e3a5a9a32 100644 --- a/addon-test-support/@ember/test-helpers/-internal/build-registry.ts +++ b/addon-test-support/@ember/test-helpers/-internal/build-registry.ts @@ -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 {