Closed jlengstorf closed 6 years ago
Duplicate of #5001
This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. Please note this issue tracker is not a help forum. We recommend using StackOverflow or our discord channel for questions.
Do you want to request a feature or report a bug?
bug
What is the current behavior?
Code coverage for fat arrow functions is misreported. After running tests, the coverage shows as missing, despite the functions being called:
However, changing to standard functions (with no other code changes) correctly shows coverage:
If the current behavior is a bug, please provide the steps to reproduce and either a repl.it demo through https://repl.it/languages/jest or a minimal repository on GitHub that we can
yarn install
andyarn test
.This commit shows the missing coverage: https://github.com/gramps-graphql/data-source-xkcd/tree/2704e75e0a6fd89ce7962f346c53d6521029cfdd
What is the expected behavior?
Tests that run using fat arrow functions should properly record coverage.
Please provide your exact Jest configuration and mention your Jest, node, yarn/npm version and operating system.
Node v9.0.0 (confirmed behavior on Node 8 and Node 6 as well) yarn v1.3.2
Jest/Babel packages and versions
Jest config: