istanbuljs / nyc

the Istanbul command line interface
https://istanbul.js.org/
ISC License
5.55k stars 353 forks source link

Unreachable test block #1488

Open DavidWeng0 opened 1 year ago

DavidWeng0 commented 1 year ago

Link to bug demonstration repository

https://domoreexp.visualstudio.com/Teamspace/_git/teams-modular-packages

Expected Behavior

As setState mock has been called, related block should be marked as covered.

Observed Behavior

Marked as not covered even it is been called. image

Testing with useState and mock has been called. image

Troubleshooting steps

Environment Information

# paste the output here
didagu commented 1 year ago

I am having the same problem in a vue project. any solution yet ? @DavidWeng0