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?

1 Answer 1


You could create a test-wrapper component that pulls in the static resource and does any initialization (if needed). LTS test would instantiate the test-wrapper component and test the library.

By the way standalone libs could be tested independently via pure unit tests as well, but the difference with using LTS would be that the tests would be testing lib's integration with other platform pieces (e.g. locker-server, ltng:require etc.).

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .