Currently we're rolled our own solution for this with the following function
- Code: Select all
function assertException(fMethod, aArg, sMessage)
{
var bCaught = false;
try
{
fMethod.apply(null, aArg);
}
catch (e)
{
bCaught = true;
}
if (!bCaught)
{
jsunit.fail(sMessage);
}
}
But would be nice if our jsunit natively provided this kind of functionality. In other unit testing packages I've seen things like assertFail or assertThrows.
Official Request: https://support.servoy.com/browse/SVY-2596