March 2026
Intermediate to advanced
512 pages
11h 26m
English
Now that we have our LWCs and corresponding Apex written, it's time to write test classes. "What! I thought this cookbook was about Lightning Web Components!" is what I am sure you are thinking to yourself right now. In order to deploy the Apex that accompanies our LWCs, we must have a minimum of 75% test class coverage, so Apex tests are fair game! We're going to begin to learn an advanced Apex testing technique called mocking and stubbing, which plays nicely with the selector pattern that we have been using in this cookbook, introduced in Chapter 3, Working with a Selector Class. Neat!
The purpose of using mocking and stubbing is to allow us to unit test our code. Unit testing allows us to test each ...
Read now
Unlock full access