New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Some fixes for require-tothrow-message
#161
Conversation
That doesn't make any sense. Would it be enough to bump
What I usually do is just do |
// code: | ||
// "const a = 'a'; expect(() => { throw new Error('a'); })" + | ||
// '.toThrow(`${a}`);', | ||
// parser: 'babel-eslint', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it should work if you set ecmaVersion
: https://eslint.org/docs/user-guide/configuring#specifying-parser-options
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should activate the template literal test, other than that this LGTM!
@SimenB Okay changes have been made. |
🎉 This PR is included in version 21.24.0 🎉 The release is available on: Your semantic-release bot 📦🚀 |
I allow for any argument type, which would include
TemplateLiteral
,CallExpression
, etc.I adjusted the tests by throwing actual errors, adding comments, adding more tests.
I couldn't add a test for
TemplateLiteral
since it requiresbabel-eslint
.I couldn't break up the commit into multiple commits because one of the precommit hooks staged and commited the entire file, even when I staged only a few lines at a time.