1
0
mirror of https://github.com/nikoksr/notify.git synced 2025-01-07 23:01:59 +02:00

build(make): add command to generate service mocks

Most services are testing by mocking them. To unify the way how and
where these mocks are being generated, I added the mock command. The
command executes go generate against all subdirectories internally. For
this to work every service needs a go:generate comment that defines the
mockery command to be executed. For examples, check
'service/amazonses/amazon_ses.go#14'. All newly added tests should make
use of this pattern.
This commit is contained in:
Niko Köser 2022-09-12 08:52:04 +02:00
parent a003cd0215
commit f692de61ba
No known key found for this signature in database
GPG Key ID: F3F28C118DAA6375

View File

@ -26,6 +26,11 @@ cover:
go test -race -covermode=atomic -coverprofile=coverage.out ./...
.PHONY: cover
mock:
@go install github.com/vektra/mockery/v2@latest
go generate ./...
.PHONY: mock
###############################################################################
# CODE HEALTH
###############################################################################