-
-
Save rafiramadhana/53581f4dac9605a30690843cb27f30c1 to your computer and use it in GitHub Desktop.
Unit test coverage check in Go
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
LOAD_TEST_ENV=env $$(cat .env.testing | xargs) | |
GOTEST=go test | |
GOTEST_PATH=./internal/usecase/... | |
GOCOVER=go tool cover | |
coverage: | |
$(LOAD_TEST_ENV) \ | |
$(GOTEST) -tags=unit -coverprofile=cover.out $(GOTEST_PATH) | |
$(GOCOVER) -html=cover.out && unlink cover.out |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment