Salesforce Certified Platform Developer II — Question 192
What are three reasons that a developer should write Jest tests for Lightning web components? (Choose three.)
Answer options
- A. To verify the DOM output of a component
- B. To verify that events fire when expected
- C. To test a component's non-public properties
- D. To test basic user interaction
- E. To test how multiple components work together
Correct answer: A, B, D
Explanation
The correct answers A, B, and D focus on validating the behavior and output of components, which are essential for ensuring that components function as intended. Option C is incorrect because testing non-public properties does not align with Jest's purpose, and option E, while important, pertains to integration testing rather than unit testing of individual components.