1

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 permanently change org data

I understood perfectly, but why we can not run in a sdbx or a developer org? it does not make sense...

Having said that, I tried to run in a dev org, executing the test suite using the CLI gives me this error message:

~ » sfdx force:lightning:test:run -a jasmineTests -u XXXXX@gmail.com                   
ERROR:  Lightning Testing Service can only run in scratch orgs, because tests can permanently change org data.

This is aligned with the documentation...cool....but if I execute the test suite directly in the UI (https:///c/jasmineTests.app) all test cases are executed...then it is not prohibited.

Do you know any way to do it using the CLI??? (assuming test data is not going to be deleted)

0

The prohibition against running LTS tests in a non-scratch org is because there's no unit test isolation around LTS tests. This has two consequences:

  1. LTS tests can destroy the real data in your developer org.
  2. The results of the tests can become unreliable due to side effects that aren't cleared on the reset of the test context (which doesn't exist).

jasmineTests.app is just a harness component that executes the JavaScript test suites, and the suites themselves are just simple JavaScript in a static resource, so you could force them to run in Production if you chose to by browsing to that application.

There's no documented way, though, to run LTS tests in a non-scratch org using the sfdx CLI.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.