[jest/valid-title] false negatives then passing a string variable instead of inlining string directly
See original GitHub issuemini example:
import { getEstimateBudgetAndTotal } from './shared'
// eslint-disable-next-line jest/valid-title
describe(getEstimateBudgetAndTotal.name, () => {
it('returns zero if passed no data', () => {
expect(getEstimateBudgetAndTotal()).toMatchInlineSnapshot(`
Object {
"totalBudget": 0,
"totalEstimate": 0,
"totalPaid": 0,
}
`)
})
})
Issue Analytics
- State:
- Created 2 years ago
- Comments:6
Top Results From Across the Web
Unit test pass string argument any string value except null or ...
What are you trying to test? If the test is not checking the guard then pass an expected string value
Read more >C++ - Inline Variables and Functions - Pablo Arias
Inlining means suppressing a call to a function by copying the function's instructions directly into the caller's body. In other words, ...
Read more >Matching fuzzy string variables - Statalist
My goal is to go through the successfully merged individuals and check for any false negatives based on there name.
Read more >Optimization Report - Pascal Analyzer
The reason is that initialization-finalization of the variable has to be done for each loop iteration. Managed variables are strings, interfaces, dynamic arrays ......
Read more >Secrets of the Glasgow Haskell Compiler inliner - Microsoft
good compiler must inline many of these calls to recover an efficiently executable program. ... In GHC, a variable's name is actually a...
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
I’ve thought about using type information to improve this rule, but realised this boils down to wanting to enforce either:
number | string | Function | FunctionLike
)The first is exactly what a linting rule is good for and what this rule can do; The second is exactly what TypeScript is for and do a lot better than a linting rule.
Now yes we could use type information to extend this rule to allow it to enforce 2. but that would require TypeScript to be available meaning you might as well just rely on TypeScript instead to handle this as it’s going to be much better at enforcing this.
So I think the solution here is that you should be using
ignoreTypeOfDescribeName
to have this rule not try and check the type at all.@G-Rath Thanx!