0.0.5 • Published 6 years ago

@tigerface/lwc-test-utils v0.0.5

Weekly downloads
1
License
MIT
Repository
github
Last release
6 years ago

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.