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
[jest/valid-describe] "First argument must be name" incorrect error #203
Comments
That use case makes sense - a PR to fix would be very welcome! 🙏 |
Workaround... describe(`${MY_REDUX_ACTION}`, () => {
//...
}); |
The same happens with classes and methods: describe(Foo.name, () => {});
describe(Foo.build.name, () => {}); As @dashmug said, you can use templates until this issue is fixed: describe(`{Foo.name}`, () => {});
describe(`{Foo.build.name}`, () => {}); |
PR here: #253 |
This also occurs when one wants to linewrap using string concatenation like so: describe('Lorem ipsum'
+ ' dolor sit amet', () => {
}); |
Hi - just chiming in here, and copying what I wrote in PR #253. tl;dr - this feels like a code smell, and this rule should probably be removed completely. It's trying to typecheck instead of lint. Quoting myself:
|
I'm going to close this as you can use |
Thanks for the tip! For posterity, I'll note that, as of version 23, it looks like https://github.com/jest-community/eslint-plugin-jest/releases/tag/v23.0.0 |
Hmm, though it looks like this only applies to |
We're getting the error "First argument must be name" [jest/valid-describe]. This appears to be because the first argument is a variable instead of a string.
However, our use case is testing redux store actions. Those action types are exported as strings. We use those strings to name our jest tests.
This seems like a reasonable situation that is incorrectly marked as wrong.
The text was updated successfully, but these errors were encountered: