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:
parent
a003cd0215
commit
f692de61ba
5
Makefile
5
Makefile
@ -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
|
||||
###############################################################################
|
||||
|
Loading…
Reference in New Issue
Block a user