Repository navigation
always use an ApplicationInstance as the test owner - #1585
Open
NullVoxPopuli-ai-agent wants to merge 2 commits into
Open
NullVoxPopuli-ai-agent wants to merge 2 commits into
NullVoxPopuli-ai-agent wants to merge 2 commits into
Conversation
Without `setApplication`, or with the `resolver` option of `setupContext`, the owner was a mock: an `EmberObject` with `RegistryProxyMixin` and `ContainerProxyMixin`, on a registry built by hand with private Ember API. The owner is now an `ApplicationInstance`. An `Application` that has only the resolver builds it, and that application is destroyed together with the instance. This removes `-internal/build-registry.ts`, the `_emberTestHelpersMockOwner` flag and its two special cases, and the imports from the `container`, `runtime` and `views` packages of `@ember/-internals`. The module no longer calls `EmberObject.extend()` at import time, which RFC 1117 deprecates. Breaking: the old registry methods on the container of the mock owner (`container.register` and others) are gone. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
`ember-strict-application-resolver` was a dependency of the test app with no test. These tests use it in the three ways an owner is built: - `setResolver()` with a `StrictResolver` and no application - the `resolver` option of `setupContext()` - `setApplication()` with a strict application Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
NullVoxPopuli-ai-agent
force-pushed
the
nvp/owner-from-application
branch
from
October 9, 2026 18:52
4d2d704 to
399ea73
Compare
NullVoxPopuli
marked this pull request as ready for review
October 12, 2026 11:17
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
An alternative to #1584, from this question: can the copied Ember internals be deleted, not rewritten?
They can. The test owner is now always an
ApplicationInstance.Change
Before, the owner was a mock in two cases:
setResolver()withoutsetApplication()resolveroption ofsetupContext(), also when an application is setThe mock was an
EmberObjectwithRegistryProxyMixinandContainerProxyMixin, on a registry built by hand with private Ember API.Now
buildOwner()creates anApplicationthat has only the resolver, and builds the instance from it. The application is destroyed together with the instance.Deleted:
addon/src/-internal/build-registry.ts_emberTestHelpersMockOwnerflag, and its special cases insetupRenderingContext()andgetRootElement()container,runtimeandviewspackages of@ember/-internals@ember/test-helpersno longer callsEmberObject.extend()at import time. That call is what stops emberjs/ember.js#21673.Breaking
container.register,container.resolveand others). They are gone.setupContext(), not only insetupRenderingContext().setResolver()and theresolveroption stay, soengineResolverForfromember-enginescontinues to work. I did not run theember-enginestests.Results
Test app in this repo, full suite:
Strict resolver
tests/unit/strict-resolver-test.jsusesember-strict-application-resolverin the three ways an owner is built:setResolver()with aStrictResolverand no applicationresolveroption ofsetupContext()setApplication()with a strict applicationEach one gives an
ApplicationInstancethat resolves a service frommodules, andrender()works.emberjs/ember.js at the commit of emberjs/ember.js#21673, full suite, with the
distof this branch in place of@ember/test-helpers5.5.0:ALL_DEPRECATIONS_ENABLED=trueOVERRIDE_DEPRECATION_VERSION=15.0.0ember.js calls
setApplication(), so its tests did not use the mock owner. Only the import-timeEmberObject.extend()broke it.🤖 Generated with Claude Code