Run the Function Locally
SFDX: Start Function from the command palette with
index.js open, or right click
index.js and select and run the
Start Function command. The function is now running locally.
Invoke the Function Locally
Now that your Function is running, you can test it by sending it a JSON payload. Create a file,
functions/myfunction/payload.json, for the payload:
VS Code automatically adds Invoke and Debug Invoke actions to the file because it recognizes it as a format used to send test events to the Function. You can now either invoke or debug to add a new Account record. For more details on how to use the VS debugger, see Salesforce Functions Developer Guide : Debugging Functions.
Stop the function by running
SFDX: Stop Function from the command palette.