jest: Bug: unable to collect coverage from an extensionless JS file

I have an executable JS file, with a node shebang. I want to collect coverage from it.

However, adding the explicit path to it to collectCoverageFrom does not cause it to show up in the coverage report (even as having zero coverage). How can I target this file? I also tried bin/** (which should match any file of any kind in the directory, according to how globs work), but maybe there’s some kind of auto-extension logic that I can’t find in the docs.

About this issue

  • Original URL
  • State: open
  • Created 7 years ago
  • Comments: 21 (18 by maintainers)

Most upvoted comments

@ljharb can you update the issue title to be formed as a bug submission instead of a help question?