Comparing unit testing and integration testing

Much of the difference between unit and integration testing relates to the scope of the code being tested and the goals of the test. Chances are you have been mixing a combination of the two on the Lightning Platform without realizing it. Before we go deeper into these differences, let's consider some characteristics of integration testing:

  • Integration tests test your key application features and related code paths under different scenarios, which can span multiple classes, including frontend code. Thus, the term "integration" refers to all code executing end to end together for a given set of inputs (including database rows) to assert a given output at the end.
  • This type of testing occurs after ...

Get Salesforce Lightning Platform Enterprise Architecture - Third Edition now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.