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
When running unit tests using the new `lightning/toast' module, I get an error.
Cannot find module 'lightning/toast' from 'path/to/lightningComponent/js'
Steps to Reproduce
// JS for component under testimport{LightningElement}from'lwc';importToastfrom'lightning/toast';exportdefaultclassFooextendsLightningElement{showToast(){Toast.show({label: 'Error!',message: 'There was an error getting data!',mode: 'sticky',variant: 'error',},this);}}
# Command to repro
sfdx-lwc-jest -- --no-cache
Expected Results
Test to pass
Actual Results
Cannot find module 'lightning/toast' from 'path/to/lightningComponent/js'
Version
@salesforce/sfdx-lwc-jest: 4.0.1
Node: 20.9.0
Possible Solution
Add a new stub for the toast module
The text was updated successfully, but these errors were encountered:
Description
When running unit tests using the new `lightning/toast' module, I get an error.
Steps to Reproduce
# Command to repro sfdx-lwc-jest -- --no-cache
Expected Results
Test to pass
Actual Results
Version
Possible Solution
Add a new stub for the toast module
The text was updated successfully, but these errors were encountered: