Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Ensure toThrow always has a message #154

Closed
garyking opened this issue Sep 21, 2018 · 3 comments · Fixed by #160 or severest/retrobot#238
Closed

Ensure toThrow always has a message #154

garyking opened this issue Sep 21, 2018 · 3 comments · Fixed by #160 or severest/retrobot#238

Comments

@garyking
Copy link
Contributor

Consider adding a new rule, which checks that toThrow always has one argument, to match the error's message.

This would have helped me a few times, when I used toThrow without any arguments, and it caught a general TypeError, etc. when instead I wanted it to catch a specific custom error.

@SimenB
Copy link
Member

SimenB commented Sep 21, 2018

Yeah, that makes sense! PR welcome 🙂

@macklinu
Copy link
Collaborator

As per the docs, would also want to check that the toThrowError() alias is checked as part of this rule too.

SimenB pushed a commit that referenced this issue Sep 29, 2018
This rule checks if `toThrow` or `toThrowError` has a message.

Fixes #154.
@SimenB
Copy link
Member

SimenB commented Sep 29, 2018

🎉 This issue has been resolved in version 21.23.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

# for free to join this conversation on GitHub. Already have an account? # to comment
Projects
None yet
3 participants