JS-DevTools / coverage-istanbul-loader

Istanbul code coverage loader for Webpack
https://jstools.dev/coverage-istanbul-loader/
MIT License
32 stars 9 forks source link

React useCallback dependency array not covered #15

Open davidKCyl opened 9 months ago

davidKCyl commented 9 months ago

Everything else is covered and working perfectly, however I've noticed that a custom React hook using two useCallbacks has both dependency arrays uncovered. The function containing the calls is being called, which would make me expect them to be covered.

For example:

const getThing = useCallback(() => {
  return client
    .get('/some-url')
    .then(res => res.json());
}, [client]);

has , [client] covered, whereas with the following it's not covered:

const getThing = useCallback(() => {
  return client
    .use()
    .get('/some-url')
    .then(res => res.json());
}, [client]);

I'm not suggesting there is an issue with this project - to rule that out, how should I go about finding the cause of this?