Class TestSuite
Object
|
+--Assert
|
+--Test
|
+--TestSuite
- class
TestSuite
- extends Test
Defined in test_suite.js
|
Constructor Summary |
TestSuite
(<Function> testClass)
Creates a suite of Tests to run.
|
|
Method Summary |
void
|
addTest(<Test> test)
Adds the given test to the suite.
|
TestResults
|
run(<TestResults> testResults)
Iteratively runs all the tests that have ever been added to the suite.
|
| Methods inherited from class Assert |
assertArraysEqual, assertArraysIdentical, assertDefined, assertEqual, assertFalse, assertIdentical, assertNotIdentical, assertNotNull, assertNull, assertTrue, assertUndefined, fail
|
TestSuite
function TestSuite(<Function> testClass)
Creates a suite of Tests to run.
Parameters:
testClass - (Optional) - the constructor of a subclass of Test. If testClass is given, the TestSuite constructor will search testClass's definition for methods whose names start with 'test'. For each such method, an instance of testClass will be created with the name of the method passed to the constructor. Each of these instances will then be added to the suite. In this way, all the methods whose names start with 'test' will be run when TestSuite's run() method is called. If testClass is not provided, the suite is left empty.
addTest
void addTest(<Test> test)
Adds the given test to the suite.
Parameters:
test - a test to run when this suite is run
run
TestResults run(<TestResults> testResults)
Iteratively runs all the tests that have ever been added to the suite.
Parameters:
testResults - (Optional) - an object to collect the results of the test run. If testResults is not given, a new instance of SimpleTestResults is supplied.
Returns:
testResults, or the newly created instance of SimpleTestResults if testResults was not given.
