The arrow function have the parameter cannot be covered
See original GitHub issueexport const testConst = ({ test }) => test;
({ test }) => test;
Statement not covered
() => function(this).querySelector('[data-test-name="dataTestName"]')
#querySelector('[data-test-name="dataTestName"]')
Statement not covered
Issue Analytics
- State:
- Created 6 years ago
- Comments:6 (3 by maintainers)
Top Results From Across the Web
Anomalies in JavaScript arrow functions - LogRocket Blog
Arrow functions do not have an arguments binding. However, they have access to the arguments object of the closest non-arrow parent function.
Read more >Official information on `arguments` in ES6 Arrow functions?
Arrow functions do not have an own arguments binding in their scope; no arguments object is created when calling them.
Read more >Arrow function expressions - JavaScript - MDN Web Docs
Arrow functions don't have their own bindings to this , arguments , or super , and should not be used as methods. ·...
Read more >13. Arrow functions - Exploring JS
Arrow functions bind very loosely; 13.5.2. No line break after arrow function parameters; 13.5.3. You can't use statements as expression bodies; 13.5.4.
Read more >Getting Started with Arrow Functions in JavaScript
The arrow function has a few limitations: you cannot use it as a method on an object, constructor, or generator function. Arrow functions...
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
From the linked issue it seems to be only happening with Babel 7. Babel 6 worked correctly. I’m observing this as well with my .map arrow funcs in my React render methods.
If your tests never call an arrow function then it is not covered, being reported as such is correct.
I’m closing this issue as it is old and does not provide enough information to troubleshoot. To look deeper we would need a minimal repository demonstrating the issue. Preferably with no other transformations included to rule out compatibility issues with other transformations.