You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
A test for a component that programmatically invokes an apex method (without mocked return value) fails with the error TypeError: Cannot read property 'then' of undefined.
TypeError: Cannot read property 'then' of undefined
Version
@salesforce/sfdx-lwc-jest: 0.12.3
(in v0.11.0 it passes)
Possible Solution
In v0.11.0, apex methods were auto-mocked to a function returning a Promise.resolve(). With 0.12.3 (#208) they are auto-mocked to a jest.fn() without return value.
The text was updated successfully, but these errors were encountered:
Description
A test for a component that programmatically invokes an apex method (without mocked return value) fails with the error
TypeError: Cannot read property 'then' of undefined
.Steps to Reproduce
Test:
Expected Results
Test passes
Actual Results
TypeError: Cannot read property 'then' of undefined
Version
(in v0.11.0 it passes)
Possible Solution
In v0.11.0, apex methods were auto-mocked to a function returning a
Promise.resolve()
. With 0.12.3 (#208) they are auto-mocked to ajest.fn()
without return value.The text was updated successfully, but these errors were encountered: