A JSTD test can contain test cases and test functions. A JSTD test case is a group of related test functions. Every test function should contain one or more assertions in order to perform the test and verify the outputs. The JSTD TestCase
object is responsible for creating the JSTD test case, and in order to create the test functions inside the test case, every test function should start with the word "test".
Every JSTD assertion represents a function that validates a condition that can return true or false. In order to pass the test function, all of the assertions inside the test function have to be true. If one or more assertions inside a test function are false, the test function fails. The following code snippet shows an example of two JSTD test cases with test functions:
TestCase1 = TestCase("Testcase1"); TestCase1.prototype.testFunction1 = function() { // One or more assertion(s) }; TestCase1.prototype.testFunction2 = function() { // One or more assertion...