[jest/valid-describe] "First argument must be name" incorrect error
See original GitHub issueimport { MY_REDUX_ACTION } from "./actions";
describe(MY_REDUX_ACTION, () => {
//...
});
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.
Issue Analytics
- State:
- Created 5 years ago
- Reactions:12
- Comments:9
Top Results From Across the Web
ESLint: Definition for rule 'jest/valid-describe' was not found ...
The rule was renamed to valid-describe-callback in eslint-plugin-jest@25.0.0 , which you updated past. You will need to rename any config ...
Read more >[R] Error: Invalid First Argument in DPlyr
You need to divide and conquer... find out which step is breaking the pipe by terminating it early at various points and if...
Read more >eslint-config-canonical - npm
Rule CN AB GG SD XO
@babel/new‑cap ❌ 👻 👻 👻 👻
@babel/no‑invalid‑this 🚨 👻 👻 👻 👻
@babel/no‑unused‑expressions 🚨 👻 👻 👻 👻
Read more >eslint-plugin-jest @ 22.5.1 .. 22.6.0 - Package Diff
+The plugin looks at the literal function names within test code, so will not ... + 'jest/valid-describe': 'error', ... + arguments: [first, second]....
Read more >https://raw.githubusercontent.com/CodingZeal/eslin...
([#59](https://github.com/CodingZeal/eslint-config-zeal/pull/59)) - Use default configuration for the `react/jsx-first-prop-new-line` rule ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Workaround…
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: