Closed ijlee2 closed 5 days ago
Do you have multiple copies of @ember/test-helpers
in your dep graph?
ember-qunit is what provides setupApplicationTest
(and friends) -- what you need to use to ultimately call setResolver / setApplication -- and ember-qunit has a peer range on test-helpers using >=
-- so try out pnpm dedupe
and/or post back here with pnpm why @ember/test-helpers -r
Related issue, but I filed it separately so this ticket can focus on the setResolver bug: https://github.com/emberjs/ember-test-helpers/issues/1490
Do your tests happen to run against embroider optimized?
I'm encountering this error with ember-intl in my project when i upgrade to v4 ember test helpers.
I believe we're waiting on: https://github.com/emberjs/ember-test-helpers/pull/1486 Which is, in turn, waiting on https://github.com/embroider-build/embroider/pull/2075
Hi, @NullVoxPopuli .
try out
pnpm dedupe
and/or post back here withpnpm why @ember/test-helpers -r
I already use dedupe
when updating dependencies. Here is the output for why
:
Do your tests happen to run against embroider optimized?
In the aforementioned CI run, the following had failed:
ember-lts-3.28
ember-lts-4.12
ember-lts-5.4
ember-lts-5.8
ember-beta
ember-canary
(embroider-optimized
had passed.)
I tried downgrading @ember/test-helpers
to 3.3.1
in the test app. ember-lts-3.28
would fail due to Could not find module @ember/renderer imported from @ember/test-helpers
, and the lint
script would fail due to type errors. (CI run, ember-try
config for 3.28
)
@ijlee2 embroider fix is published... maybe your issue is now resolved
@mkszepp Thanks for letting me know.
I'm still getting issues after updating @embroider/*
to the latest, so I think there may need to be a fix from @ember/test-helpers
.
https://github.com/ember-intl/ember-intl/actions/runs/10662230469
@ijlee2 yes i haven seen the same issue in ember-power-select...
I have tested today using strict v4.0.0 (instead of 4.0.2) see In this case my issue for ember v3.28 is still present, but for 4.4... it was solved...
It looks like the adding externals
in test-helpers was at the begin good, because it has solved embroider-safe, but now after the embroider fix was released, maybe its not anymore necessary and is causing an other issue...
ould fail due to Could not find module @ember/renderer imported from @ember/test-helpers,
You'll want to upgrade your @embroider/*
deps - pnpm update @embroider/* -r
script would fail due to type errors
test-helpers does not support TS < 5 -- which versions are you using?
3.28
test-helpers v3.2.1 can still be used
Related -- I find that when I'm in a bit of a dependency snaffu, I'll try out pnpm's slower
shared-workspace-lockfile=false
which better isolates dependencies from the different packages in your repo.
Additionally, with wide-peer-support in libraries comes some fun problems -- we often need to use injected dependencies to get peers resolving correctly (ie: not resolving dev deps).
Additionally, with wide-peer-support in libraries comes some fun problems -- we often need to use injected dependencies to get peers resolving correctly (ie: not resolving dev deps).
@NullVoxPopuli What fixed the ember-try
issue for me was to add dependenciesMeta.injected
. (https://github.com/ember-intl/ember-intl/pull/1918/commits/20d19b38e39c59885887463fb941e61e811814b9)
I'm not sure yet if we should be encouraging people to use an opt-in feature in pnpm
(what about npm
and yarn
users?), because (1) ember-try
for ember-intl
worked fine with @ember/test-helpers@3.3.1
, and (2) other v2 addons that I maintain have been working fine without dependenciesMeta.injected
in the test-app
(where ember-try
is run also).
Anyway, I can close this issue now. I appreciate your help. ✨
As reported in https://github.com/ember-intl/ember-intl/issues/1916, when a consumer of
ember-intl
tried to update@ember/test-helpers
tov4
, they encountered the error message,The reason is,
ember-intl
(a v1 addon) hadn't declared@ember/test-helpers
as a (peer) dependency. I can verify this assumption in https://github.com/ember-intl/ember-intl/pull/1918, but the fix can't be released because severalember-try
scenarios forember-intl
failed with another error (CI run):Could you tell me what the error message wants me to do? Is this perhaps a bug in
@ember/test-helpers@4.0.2
?