Book Image

Learning Salesforce Lightning Application Development

By : Mohit Shrivatsava
Book Image

Learning Salesforce Lightning Application Development

By: Mohit Shrivatsava

Overview of this book

Built on the Salesforce App Cloud, the new Salesforce Lightning Experience combines three major components: Lightning Design System, Lightning App Builder, and Lightning Components, to provide an enhanced user experience. This book will enable you to quickly create modern, enterprise apps with Lightning Component Framework. You will start by building simple Lightning Components and understanding the Lightning Components architecture. The chapters cover the basics of Lightning Component Framework semantics and syntax, the security features provided by Locker Service, and use of third-party libraries inside Lightning Components. The later chapters focus on debugging, performance tuning, testing using Lightning Testing Services, and how to publish Lightning Components on Salesforce AppExchange.
Table of Contents (22 chapters)
Title Page
PacktPub.com
Foreword
Contributors
Preface
Index

Chapter 14. Unit Testing Lightning Components

Creating unit tests for code components helps in quickly figuring out issues with the component when a piece of code is redesigned or additional logic is added to enhance the functionality. Unit tests test a single function or object in isolation. Salesforce provides Apex unit tests for all the backend business logic written in Apex. For Lightning Components, Salesforce provides the Lightning Testing Service (LTS). The LTS is a set of wrappers for Jasmine and Mocha JavaScript testing frameworks. Jasmine is a popular framework to test JavaScript applications on, and uses a wide set of features, assisting inbehavior-driven development(BDD), while Mocha is an emerging framework and requires additional frameworks (such as Chai, Sinon, or Cucumber) to work with it in order to provide a complete toolset to use to write unit tests. In this chapter, we will strictly cover only LTS, using Jasmine as the testing framework. The LTS (found at https://github...