QUnitGS2
QUnitGS2 copied to clipboard
Tests with uncaught exceptions disappear
Repro: Run a test that throws an uncaught exception, for example:
var QUnit = QUnitGS2.QUnit;
function doGet() {
QUnitGS2.init();
// Just to demonstrate that QUnitGS2 plumbing is hooked up correctly.
QUnit.test("simple numbers", function( assert ) {
assert.equal(1 + 1, 2, "addition");
});
QUnit.test("exception", function( assert ) {
Logger.log("before exception");
throw "uh oh";
Logger.log("after exception");
});
QUnit.start();
return QUnitGS2.getHtml();
}
function getResultsFromServer() {
return QUnitGS2.getResultsFromServer();
}
I'm using the V8 runtime; not sure if that matters.
Expected: something shows up in the results page, or at least in the log that indicates an exception was thrown.
Actual: no indication in the UI that the test was even defined:
Just ran into the same problem. It took me a while to realize I'd made an error in my "before" test setup.
Worked on (around) this for a few hours, and basically any assert.throws()
call needs a try/catch else the other tests aren't run.
Not sure if this is related, but the test suite page points to the live test results, which fails at line 45.