How to get Jest to have coverage for export only lines?

I have an index.ts top file in an NPM library which has only export statements.

i.e.:

export * from "./foo"
export * from "./bar"

SonarCloud is showing those lines as not covered, as it is expected that those should have no tests. I know we can live with the missing coverage but it is somehow annoying.

I know I could also ignore the file, but then I would need to do the same for every file with a similar purpose that group and export components down inside the library.

Is there any best practice or configuration I can use to overcome that?



Read more here: https://stackoverflow.com/questions/67388165/how-to-get-jest-to-have-coverage-for-export-only-lines

Content Attribution

This content was originally published by Felipe Plets at Recent Questions - Stack Overflow, and is syndicated here via their RSS feed. You can read the original post over there.

%d bloggers like this: