LIGHTNING COMPONENT TESTING WITH JASMINE - PowerPoint PPT Presentation

About This Presentation
Title:

LIGHTNING COMPONENT TESTING WITH JASMINE

Description:

Jasmine is a behaviour-driven development framework - that is used for the purpose of testing Javascript code. If Jasmine is adopted for testing of Lightning components, then there are obviously some advantages for this. Let us throw some light on the advantages: What are the Advantages ? Some advantages that Jasmine offers are:nnIt is built easy to set up and it is possible to set up in any scenario It has no requirement for DOM It has no dependency on any other Javascript frameworknIt helps to write tests in easy steps because it comes with clean syntax – PowerPoint PPT presentation

Number of Views:22
Updated: 17 December 2018
Slides: 11
Provided by: cloudanalogy

less

Transcript and Presenter's Notes

Title: LIGHTNING COMPONENT TESTING WITH JASMINE


1
  • Lightning Component Testing with Jasmine
  • Jasmine is a behaviour-driven development
    framework - that is used for the purpose of
    testing Javascript code.

2
What are the Advantages ?
  • Some advantages that Jasmine offers are
  • It is built easy to set up and it is possible to
    set up in any scenario
  • It has no requirement for DOM
  • It has no dependency on any other Javascript
    framework
  • It helps to write tests in easy steps because it
    comes with clean syntax

3
What is lightning Test Services?
Salesforce has come with a new concept Lightning
Test Services(LTS). LTS is a set of tools and
services - that create test suites for these
Lightning components. It helps in the validation
of the client-side behaviour of these components.
4
You can install LTS in your Salesforce org in the
following two ways
  • As an unmanaged package
  • Install LTS by using a command in Salesforce
    Developer Experience(SFDX)

5
Steps to follow for installing Jasmine
We need to follow the following steps for
installing Jasmine and use it for further testing
the Lightning components 1. Installation of
Jasmine with the above SFDX command sfdx
forcelightningtestinstall
6
2. Once the installation is completed, you can
start to navigate in your browser - so as to open
the Jasmine test runner page. sfdx
forceorgopen -p /c/jasmineTests.app 3. Next,
Lightning component is to be used by Lightning
Test Service (LTS).
7
4. Now we need to create a Javascript file
containing Jasmine test method and upload it as a
static resource. 5. This static resource then
gets uploaded in Salesforce named as
JasmineTestDatatable. The reference to this app
has to be added to the static resource in
JasmineTests.app.
8
6. Finally, the Jasmine Test Runner is opened
with the following URL. https//ltYourDomaingt.light
ning.force.com/c/jasmineTests.app. This will show
the output of the testing in the form of which
test passed and which of the tests failed. It
also displays the pass and fail percentages.
9
7. Also the SFDX commands can be used to create a
Lightning test with a basic template, by using
the following commands Sfdxforcelightningtest
create
10
Thank You
Write a Comment
User Comments (0)
About PowerShow.com