lukeed / uvu

uvu is an extremely fast and lightweight test runner for Node.js and the browser
MIT License
2.97k stars 100 forks source link

fix assert throws() typing #230

Closed farwayer closed 7 months ago

Rich-Harris commented 1 year ago

The alternative would be to fix the implementation of throws to match the types. This would be preferable, in my view — I want to compare an error message against an expected string far more often than I want to convert it to a regex. Right now, if you include a string (or, in uvu's eyes, don't include an expected value) then all it's doing is checking that some error was thrown, which feels a bit too loosey-goosey.

benmccann commented 1 year ago

I was just about to comment with the same suggestion. +1 to fixing the implementation rather than the types