OK, here's something I just brewed based on some earlier work. I hope this would meet your needs.
Lightweight Universal JavaScript Testing Framework
jsUnity is a lightweight universal JavaScript testing framework that is
context-agnostic. It doesn't rely on
any browser capabilities and therefore
can be run inside HTML, ASP, WSH or
any other context that uses
JavaScript/JScript/ECMAScript.
Sample usage inside HTML
<pre>
<script type="text/javascript" src="../jsunity.js"></script>
<script type="text/javascript">
function sampleTestSuite() {
function setUp() {
jsUnity.log("set up");
}
function tearDown() {
jsUnity.log("tear down");
}
function testLessThan() {
assertTrue(1 < 2);
}
function testPi() {
assertEquals(Math.PI, 22 / 7);
}
}
// optionally wire the log function to write to the context
jsUnity.log = function (s) { document.write(s + "</br>"); };
var results = jsUnity.run(sampleTestSuite);
// if result is not false,
// access results.total, results.passed, results.failed
</script>
</pre>
The output of the above:
2 tests found
set up
tear down
[PASSED] testLessThan
set up
tear down
[FAILED] testPi: Actual value does not match what's expected: [expected] 3.141592653589793, [actual] 3.142857142857143
1 tests passed
1 tests failed