Closed skruppy closed 3 years ago
does thrown
works for you?
unittest {
Throwable ex = ({throw new SomeException("msg");}).should.throwException!SomeException.thrown;
}
Kind of. I actually need the correct type, which is not a big problem since I can simply use thrown
and cast(SomeException)
. This is my current workaround. But I guess it's a regression bug.
Things I don't understand:
throwException
does not return ThrowableProxy
as said hereThrowableProxy
of original
seems to be right, but as said before it also seems not to be used but I also does not find another implementation. ... I'm really confused :)I had to change the library structs to have a more modern interface like chai from js. This helps on allowing other devs to bind their custom checks to the lib. If you want to check the latest work please have a look at the master branch.
If you really need the prev behavior i’ll need to see how can I do this without adding more templates… because I also aim to improve the compilation speed with this new version.
Unfortunately the docs are outdated. I did not have much time to focus on this project and the current version is still an alpha. I’ll make a beta release once I can get some focus time on it.
Oh OK. The API change is then probably what confused me then. Since there is a workaround and this change was intended and hence not a regression, I'll close this issue (even if original
was convenient :wink:).
Maybe it's a good idea to mark original
or ThrowableProxy
some day with deprecated("Hint to new API")
.
Thanks for all your great work :heart:
The following example compiles and behaves as expected in Version 0.13.0 but fails to compile with 0.14.0-alpha.8 (return type of
original
isExpect
, not the expectedSomeException
)