The Jasmine testing framework encourages the use of BDD in the applications on which it is used. In this section, we will briefly look into the syntax and steps needed to write a unit test for a JavaScript. The extensive documentation can be found at Jasmine's documentation site, at https://jasmine.github.io/.
Before we dive into a working example of how to use Jasmine to test the JavaScript, let's look at some of the terms that will be used in the upcoming sections, such as suite, spec, matcher, spies, setup and teardown.
A suite is a set of test cases that you want to test for a JavaScript object or function. You can think of a suite as being similar to a test class in Apex, if you want to make a comparison.
A suite uses a global describe
function, and the function has two parameters: a string that is the title of the test suite and a function that implements the test suite.
The syntax is as follows:
//This is Test Suite describe("Test...