Develop Secure Code
Install Jest
Run Jest Tests
Write Jest Tests
Write Jest Tests for Wire Service
End-to-End Tests
Jest Test Patterns
Jest is a powerful tool with rich features for writing JavaScript tests. Use Jest to write unit tests for all of your Lightning web components.
Run Jest tests at the command line or (with some configuration) within your IDE. Jest tests don’t run in a browser or connect to an org, so they run fast. When run in “watch mode” they give you immediate feedback while you’re coding. Jest tests work only with Lightning web components, they don’t work with Aura components.
Write Jest tests to:
@api properties and methods, events)The lwc-recipes repo is filled with Jest tests. Look for Jest tests in the __tests__ folders within the Lightning web components in force-app/main/default/lwc.
Tip
See Also