LTS

LTS provides a wrapper for Jasmine and Mocha. The code for LTS is open source, so it can be easily tailored to work with other frameworks as well.

The testing service comprises a global $T object that contains methods to create components, run callbacks, fire application events, and destroy components. The code for the $T API can be found at https://github.com/forcedotcom/LightningTestingService/blob/master/Lightning-component-tests/test/default/staticresources/lts_testutil.resource.

Salesforce recommends that you write and test for the following behaviors in Lightning Components:

Test use case Description
DOM rendering

Validates that components are added where and when they should be.

Component state

Ensures that components ...

Get Learning Salesforce Lightning Application Development now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.