Archived
1
0
This repository has been archived on 2023-12-16. You can view files and clone it, but cannot push or open issues or pull requests.
luminotes/static/jsunit/app/jsUnitTestSuite.js
Dan Helfman 61c6ab3fb0 Beginning stubs for client-side javascript "unit" tests. (Probably more like
functional tests, unless a whole lot of mock objects are introduced, which
isn't entirely out of the question). Uses JsUnit, which is included in this
commit.
2007-09-06 10:25:06 +00:00

45 lines
975 B
JavaScript

function jsUnitTestSuite() {
this.isjsUnitTestSuite = true;
this.testPages = Array();
this.pageIndex = 0;
}
jsUnitTestSuite.prototype.addTestPage = function (pageName)
{
this.testPages[this.testPages.length] = pageName;
}
jsUnitTestSuite.prototype.addTestSuite = function (suite)
{
for (var i = 0; i < suite.testPages.length; i++)
this.addTestPage(suite.testPages[i]);
}
jsUnitTestSuite.prototype.containsTestPages = function ()
{
return this.testPages.length > 0;
}
jsUnitTestSuite.prototype.nextPage = function ()
{
return this.testPages[this.pageIndex++];
}
jsUnitTestSuite.prototype.hasMorePages = function ()
{
return this.pageIndex < this.testPages.length;
}
jsUnitTestSuite.prototype.clone = function ()
{
var clone = new jsUnitTestSuite();
clone.testPages = this.testPages;
return clone;
}
if (xbDEBUG.on)
{
xbDebugTraceObject('window', 'jsUnitTestSuite');
}