Stack Exchange Network

Stack Exchange network consists of 175 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

Questions tagged [jasmine]

Jasmine is a behavior-driven development framework for testing JavaScript code. The Lightning Testing Service has built in wrappers for Jasmine.

0
votes
0answers
82 views

Lightning Testing service failing for apex

I am trying to mock the apex method response and trying to test attributes with the fake response.But It is failing. I am getting error message: Error:Expected 0 to be 1 Error:Expected false to be ...
2
votes
1answer
31 views

Jasmine or Mocha wrapper in Lightning Testing Service does not provide actual code coverage. How to measure JavaScript code coverage?

I have to test JavaScript code in lightning components with % code coverage. Lightning testing service report does not include code coverage information. Is there any way to measure JavaScript code ...
0
votes
0answers
139 views

“TypeError: component.find is not a function” When trying to test by using LTS: Jasmine install through sfdx

Since I have install jasmine LTS from sfdx am using jasmine/2.6.1 . Write a test as said in the example for c:egGlobalValueProvider But I am getting an error in scratch org :TypeError: component.find ...
2
votes
0answers
291 views

Lightning Component Testing Code Coverage

I need some help here with lightning component testing. So I'd been building lightning component test on Salesforce using Jasmine testing framework. I was wondering if anyone here successfully ...
0
votes
1answer
231 views

how to test handler action and promise within jasmine and Lightning test service

component handler which is need to be call <aura:handler name="init" value="{!this}" action="{!c.getLoginUrls}" /> Component method ({ getLoginUrls : function(component, event, ...
3
votes
1answer
428 views

Testing Lightning component that fires event based upon a child component's `onchange` action

I'm trying to write Jasmine/LTS tests for a component that embeds a <lightning:combobox>. The method I'm attempting to test fires a component event within a controller method that is bound to ...
6
votes
1answer
453 views

How to use lightning testing service without using Salesforce DX?

I am working on a salesforce managed package project which is not in DX. I want to start writing unit test cases for lightning component using lightning test service. I have gone through the github ...
8
votes
0answers
247 views

Is is possible to spyOn a helper function in a Lightning Testing Service (LTS) test?

In How to mock or configure lightning:workspaceAPI in Lightning Testing Service (LTS) tests? the answer suggests using Jasmine's spyOn to call a fake function in a test and so work-around an API that ...