Spec

A spec is a test case inside the test suite. A test suite comprises one or more test specs. A test spec comprises a describe function and one or more it functions. An it function is comprised of two parameters, one of which is a string and the other of which is a function that implements the test case. Treat this like an Apex test method.

A spec also comprises of expect statements that are used for asserting the behavior. Treat asserts are equal to system.assert in Apex test methods. The expect statements compare the actual object against the matcher object. There are out-of-box matchers available. You can refer to the API guide to learn more about them at https://jasmine.github.io/api/edge/matchers.html.

The following table describes ...

Get Learning Salesforce Lightning Application Development now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.