Skip to content

Static analysis tool to detect assertion-free tests in golang projects

License

Notifications You must be signed in to change notification settings

the4thamigo-uk/noassert

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

noassert

Static analysis tool to detect assertion-free tests in golang projects

Build Status Coverage Status

Description

To write useful unit tests, developers must provide assertions to validate behaviour is correct. However, developers can sometimes forget to add such assertions, or worse, they might write assertion-free tests in order to obtain good code coverage.

This simple static-analysis tool aims to flag up any tests that do not call testing.Fail at some point in their callgraph.

The tool does nothing to help you write 'good' unit tests however...

Getting Started

Run :

go get github.com/the4thamigo_uk/noassert

This will build and install the binary in the GOROOT/bin folder.

To use simply specify a package path e.g. :

noassert "github.com/the4thamigo-uk/noassert/testlib"

Road Map

Improvements will be made to support additional command line arguments.

About

Static analysis tool to detect assertion-free tests in golang projects

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages