LWC Test Creator is an open-source VS Code extension built with JavaScript and the VS Code Extension API enabling users to quickly create boilerplate tests for Salesforce Lightning Web Components.
This extension creates a Lightning Web Component test template in the appropriate directory and only requires the user to enter the name of the Lightning Web Component as opposed to the path of the Lightning Web Component *.JS file or making the user change to the appropriate target directory while using the force:lightning:lwc:test:create
CLI command.
Installation: https://marketplace.visualstudio.com/items?itemName=MaxGoldfarb.lwc-test-creator
- Create Jest Test
- Creates a
__tests__
directory in the appropriate directory for the target Lightning Web Component. - Creates a
<Lightning Web Component Name>.test.js
file with boilerplate code in the__tests__
directory. - How to use (after installation):
- Open VS Code Command Palette
- Search for & select the
Create Jest Test
LWC Test Creator command - Type in the name of the target Lightning Web Component & press 'Enter'
- Creates a
- VS Code ^v1.56
- text-encoding-polyfill
- Overwrites content in an existing test file for the target Lightning Web Component if the test file is named
<Lightning Web Component Name>.test.js
.
Initial release of LWC Test Creator