Skip to content

Use the public mixins in tests, not the internal copies - #21689

Merged
NullVoxPopuli merged 2 commits into
emberjs:nvp/deprecate-mixin-followupsfrom
NullVoxPopuli-ai-agent:nvp/mixin-tests-no-internal
Oct 10, 2026
Merged

NullVoxPopuli merged 2 commits into
emberjs:nvp/deprecate-mixin-followupsfrom
NullVoxPopuli-ai-agent:nvp/mixin-tests-no-internal

Conversation

@NullVoxPopuli-ai-agent

@NullVoxPopuli-ai-agent NullVoxPopuli-ai-agent commented Oct 10, 2026 •

Copy link
Copy Markdown
Contributor

Tests in #21588 import the silent -internal copies of the deprecated mixins. This PR makes those tests use the public mixins.

It follows the review comment in #21687 (comment).

The base is nvp/deprecate-mixin-followups, the branch of #21588. The diff is one commit and 5 test files.

What changed

Each test below now imports the public mixin, expects its deprecation, and uses testUnless(...isRemoved). The tests go away with the deprecation.

Test file Mixin
runtime/tests/mixins/array_test.js EmberArray
glimmer/tests/integration/helpers/tracked-test.js MutableArray
runtime/tests/mixins/container_proxy_test.js ContainerProxyMixin
runtime/tests/mixins/target_action_support_test.js TargetActionSupport
ember/tests/service_injection_test.js _ProxyMixin

Changes that are not an import swap

  • TestArray#init in array_test.js now calls super.init. Without that call, the EmberArray deprecation does not fire.
  • Three tests in array_test.js do not use the mixin. They moved to a new module, @each support, so they still run after the removal.
  • The assert.expect counts went up by one in two ContainerProxyMixin tests. The deprecation expectation adds one assertion.
  • Each TargetActionSupport test has one expectation. Its pattern matches the mixin deprecation and the triggerAction deprecation. A production build runs one assertion for all expectations of a test, so two expectations give different counts in the two builds.

What stays

packages/@ember/object/tests/mixin/deprecation_test.js still imports InternalMixin. That test checks that the internal constructor does not fire the deprecation, so the internal copy is its subject.

Open point

The three ContainerProxyMixin tests are the only tests of ownerInjection on an owner and of the destruction order of an owner. After the removal they are skipped. EngineInstance still uses that code.

Test results

Full suite, local run:

Mode Pass Skip Fail
default 9486 18 0
ALL_DEPRECATIONS_ENABLED=true 9486 18 0
OVERRIDE_DEPRECATION_VERSION=15.0.0 8146 594 0
production build 9277 65 0
production build, optional features 9277 65 0

🤖 Generated with Claude Code

Tests imported the silent `-internal` copies of the deprecated mixins.
Such a test stays after the deprecation is removed, and it keeps the
internal copy in use.

These tests now import the public mixin, expect its deprecation, and
use `testUnless(...isRemoved)`. They go away with the deprecation.

- `EmberArray` in `runtime/tests/mixins/array_test.js`
- `MutableArray` in `glimmer/tests/integration/helpers/tracked-test.js`
- `ContainerProxyMixin` in `container_proxy_test.js`
- `TargetActionSupport` in `target_action_support_test.js`
- `_ProxyMixin` in `ember/tests/service_injection_test.js`

`TestArray#init` in `array_test.js` now calls `super.init`. Without
that call, the deprecation of the mixin does not fire.

Three tests in `array_test.js` do not use the mixin. They moved to
their own module, so they still run after the removal.

`mixin/deprecation_test.js` still imports `InternalMixin`. That test
checks that the internal constructor does not fire the deprecation.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A production build runs one assertion for all deprecation
expectations of a test. A development build runs one assertion for
each expectation. Two expectations made `assert.expect` fail in the
production build jobs.

Each test now has one expectation. Its pattern matches the mixin
deprecation and the `triggerAction` deprecation. The `assert.expect`
counts are back to their values on the base branch.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@NullVoxPopuli
NullVoxPopuli merged commit 3ba8803 into emberjs:nvp/deprecate-mixin-followups Oct 10, 2026
70 checks passed
@NullVoxPopuli
NullVoxPopuli deleted the nvp/mixin-tests-no-internal branch October 10, 2026 17:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants