This project is read-only.
1

Closed

bug in TestClass.throws

description

It looks like the "throws" statement in TestClass is not working.
The following code works fine (test succeeds because exception is thrown):
    GoodTest5()
    {
        this.throws(() =>
        {
            console.log("Exception thrown. Test should succeed.");
            throw new Error("exception!")
        }, "Code should throw an exception.");
    }
However, the following code does not work as expected (test still succeeds, even though no exception is thrown):
    BadTest5()
    {
        this.throws(() =>
        {
            console.log("No exception thrown here. Test should fail!");
        }, "Code should throw an exception.");
    }
Closed Oct 13, 2015 at 7:51 PM by Sohnee

comments

KoenT_IM wrote Oct 13, 2015 at 1:35 PM

I entered an issue for this in github instead (as that holds the current repo):
https://github.com/Steve-Fenton/tsUnit/issues/10

This issue here can be deleted...

Sohnee wrote Oct 13, 2015 at 7:50 PM

Thanks - the GitHub issues list is where I fix stuff - there should be a fix shortly over on the one you raised over there...

https://github.com/Steve-Fenton/tsUnit/issues/10

wrote Oct 13, 2015 at 7:51 PM