File-level code coverage target

Is there any way to specify that a specific file has x% coverage?

We are using flags to specify coverage for a test suite, but we would like to ensure a specific file has x% coverage.

Hi @Elliot128

I think you may be able to use flags for this, if you create a flag for just that path/file Flags

Can you let me know if that works?

Thanks for getting back to me, we actually went with just specifying paths separately.

We are also wondering if there is any way to ensure that all files in a directory meet a minimum coverage? My understanding is the target property in yaml is for the avg coverage of all lines in the directory, but we’d also like to impose a minimum for each individual file in that directory.

I think this one is more a feature request. If you can move it to that section, I’ll be happy to share it with the product team.

Closing in favor of Allow configuration of target coverage per file