Create LWC Jest Test
sf_create_lwc_jest_testGenerate a Jest test file for an existing Lightning Web Component and deploy it to the component's tests folder via Metadata API.
Instructions
Creates a Jest test file for an existing LWC component using @salesforce/lwc-jest conventions. The test file is placed in the tests subfolder of the component bundle and deployed via the Metadata API.
componentName: LWC component name in camelCase, e.g. 'myButton' testContent: Jest test file content (JavaScript) apiVersion: Salesforce API version
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| apiVersion | No | API version, e.g. '62.0' | 66.0 |
| testContent | Yes | Jest test file content (JavaScript) | |
| componentName | Yes | LWC component name (camelCase), e.g. 'myButton' |