@tigerface/lwc-test-utils
v0.0.5
Published
A collection of helpful utility functions for unit testing LWC components with Jest. https://edodso2.github.io/lwc-test-utils/
Downloads
3
Maintainers
Readme
LWC Test Utils
A collection of test utilities for unit testing LWC components with Jest.
Turn repetitive code like this:
// update the inputs value
inputEl.value = value;
// fire change event
const changeEvent = new CustomEvent('change');
inputEl.dispatchEvent(changeEvent);
Into clean declarative code like this:
Simulate.inputChange(lightningInputEl, NEW_VALUE);
Getting Started
Install the package:
npm install -D @tigerface/lwc-test-utils
Import the Simulate class:
import { Simulate } from '@tigerface/lwc-test-utils';
Simulate!
Simulate.inputChange(lightningInputEl, NEW_VALUE);
Contributions are welcome.