smartystreets / goconvey

Go testing in the browser. Integrates with `go test`. Write behavioral tests in Go.
http://smartystreets.github.io/goconvey/
Other
8.26k stars 555 forks source link

Excluding certain files/blocks of code from coverage? #465

Open importnil opened 7 years ago

importnil commented 7 years ago

Is there a possibility of excluding some files/functions (especially main() thread func) from coverage %?

MrJoy commented 6 years ago

I, too, would like an answer to this.

I've wound up with a pattern of having package/testutils.go, and a testutils package: The former providing scaffolding/mocks to be used in other packages' tests, and the latter providing some scaffolding/mocks that are useful across all packages.

The end result of this is that my coverage numbers tend to be somewhat inflated by the code in these files (less so the testutils package, since that has no tests of its own and thus doesn't even show up on the coverage list).