Re: CfC: WebApps testing process; deadline April 20

On Mon, Apr 18, 2011 at 4:52 PM, Garrett Smith <dhtmlkitchen@gmail.com> wrote:
> A test with 0 assertions could be used to test exceptions but only if
> the testing framework provides for "@throws" annotation (my
> TestRunner.js does).

testharness.js has an assert_throws() function that can be used in
cases where an exception is expected.  You could still sensibly have a
test with zero assertions if all you're testing is that something does
*not* throw an exception, though.  I've done that in some of my test
suites, where I needed to do some setup for groups of tests, wanted
exceptions thrown during setup to not interfere with unrelated tests,
and wanted such exceptions to be reported as failures.

Received on Monday, 18 April 2011 23:01:44 UTC