Closed pozil closed 1 day ago
The change in the v6 release was just to bump LWC from v6 to v7. This appears to be a regression in the v7.2.6 release, likely due to https://github.com/salesforce/lwc/pull/4468.
Could you re-open this issue in the LWC repo?
I cannot repro in @salesforce/sfdx-lwc-jest 6.0.0, only in 6.0.1. Comparing the versions between the two, I see that lwc-test was upgraded from 16.0.0 to 16.1.0. Given the changes released in 16.1.0 I suspect this change to Jest mocks which was reverted in v17.0.0.
So it seems that sfdx-lwc-jest needs to update its dependencies.
Description
Upgrading a project dependency from
@salesforce/sfdx-lwc-jest@5.1.0
to6.0.0
or6.0.1
introduces a regression that breaks Apex wire mocking.Steps to Reproduce
@salesforce/sfdx-lwc-jest@5.1.0
.@salesforce/sfdx-lwc-jest
version (6.0.1
at time of writing).You can also isolate the issue to this single simple test: https://github.com/trailheadapps/lwc-recipes/blob/main/force-app/main/default/lwc/contactList/__tests__/contactList.test.js#L38
Expected Results
All tests should continue to pass.
Actual Results
No specific error from sfdx-lwc-jest but tests are failing because the data doesn't seem to be injected from the apex wire mock.
Version