Podcast #128: We chat with Kent C Dodds about why he loves React and discuss what life was like in the dark days before Git. Listen now.

Questions tagged [lightning-testing-service]

The Lightning Testing Service, or LTS, is a set of tools and services that let you create test suites for your Lightning components using standard JavaScript test frameworks, such as Jasmine and Mocha.

Filter by
Sorted by
Tagged with
1
vote
1answer
91 views

Cannot install Lightning testing service in scratch orgs anymore

It seems starting last week or so, installing managed packages in scratch orgs require specifying security type. However, SecurityType is not a valid parameter for the LTS install command: $ sfdx ...
0
votes
0answers
90 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 ...
1
vote
1answer
93 views

LTS and sfdx/developer orgs

I was reviewing the capabilities of the LTS (lightning testing service) and there is a cool sentence in the documentation: Lightning Testing Service can only run in scratch orgs, because tests can ...
2
votes
1answer
58 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
236 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 ...
0
votes
1answer
141 views

Unable to execute lightning sample test for non-Chrome browser

So, I've never done this before, so I beg a pardon if the answer is quite obvious. I wanna dive into lightning testing service, but I've faced the following problem at the very beginning. So, after ...
5
votes
0answers
95 views

Stub Lightning Data Service response in Lightning Test Service (Jasmine)

Using Jasmine I can simply stub response as this before $T.createComponent: $A.enqueueAction = jasmine.createSpy().and.callFake((action) => { var cb = action.getCallback("SUCCESS") cb.fn....
3
votes
1answer
551 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 ...
17
votes
1answer
2k views

What do you use to automate the testing of your Lightning Components?

We've written some Lightning Testing Service tests but its been hard work given the asynchronous nature of the code and that the LockerService blocks access to the underlying DOM. I'm now wondering if ...
2
votes
1answer
70 views

Lightning test service: test static resource code

I've moved some code to shared static resource using the approach described here. And now I wonder: is it possible to directly test this code using Lightning Test Service?
9
votes
1answer
315 views

Does the LockerService make Selenium tests impossible?

When running Lightning Testing Service tests, the impact of the LockerService is evident such as not being able to see the DOM nodes of a lightning:... component (different namespace) wrapped by one ...
6
votes
1answer
509 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 ...
9
votes
0answers
264 views

LTS: How to test behavior dependent on afterScriptsLoaded

I’m looking for help/examples for setting up tests of a component which calls a load() method via afterScriptsLoaded, then renders data based on the result of the load (which calls a server-side ...
8
votes
0answers
273 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 ...
6
votes
1answer
340 views

How to mock or configure lightning:workspaceAPI in Lightning Testing Service (LTS) tests?

I have a Lightning Component that uses the lightning:workspaceAPI component to detect that it is (or is not) running in the console view. I'm starting to look at setting up some Lightning Testing ...
6
votes
1answer
486 views

How to run Lightning Test Service (LTS) from Jenkins hosted on AWS against e.g. BrowserStack?

We run Karma and Protractor Angular tests from a Jenkins continuous integration (CI) server hosted on AWS. Those two frameworks allow the browser to be run remotely in e.g. https://www.browserstack....
0
votes
0answers
40 views

Lightning Test Service - can you call actions directly or do they have to be wrapped in aura:method first?

Looking in couple of examples, I can't seem find a way to call actions and action helpers directly. Is that not supported? Edit: I think it's not possible, here's a similar issue (test click of a ...
21
votes
1answer
1k views

How will Lightning Testing Service (LTS) be delivered when it is GA?

Took a first look at the Lightning Testing Service (LTS) that is in (open) pilot today: The Lightning Testing Service, or LTS, is a set of tools and services that let you create test suites for ...
32
votes
3answers
2k views

What to Javascript-test in Lightning components and what not

Let's be honest. As an Apex developer used to provide near-100% test coverage for Apex the same should be true for Lightning components. As we move more code from the server to the client more test ...