Skip to content

glewis-ANet/go-unittesting

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

go-unittesting

Example unit testing project for GoLang

This project demonstrates some unit testing features in GoLang using

  • Testify (assertion and mocking package)
  • Mockery (mock generator)

Relevant commands:

mockery -dir interfaces -name Serialiser

Command used to generate mocks (in this case the mock for the Serialiser interface)

go test -v -coverprofile=coverage.out ./...

Run the tests and generate code coverage

go tool cover -html=coverage.out

View the coverage report in HTML format

About

Unit testing examples for GoLang

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages