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

Introduction to Jasmine


The Jasmine testing framework encourages the use of BDD in the applications on which it is used. In this section, we will briefly look into the syntax and steps needed to write a unit test for a JavaScript. The extensive documentation can be found at Jasmine's documentation site, at https://jasmine.github.io/.

Jasmine syntax and terminology

Before we dive into a working example of how to use Jasmine to test the JavaScript, let's look at some of the terms that will be used in the upcoming sections, such as suite, spec, matcher, spies, setup and teardown.

Suite

A suite is a set of test cases that you want to test for a JavaScript object or function. You can think of a suite as being similar to a test class in Apex, if you want to make a comparison.

A suite uses a global describe function, and the function has two parameters: a string that is the title of the test suite and a function that implements the test suite.

The syntax is as follows:

//This is Test Suite
describe("Test...