Skip to content

Latest commit

 

History

History
34 lines (21 loc) · 1.22 KB

README.md

File metadata and controls

34 lines (21 loc) · 1.22 KB

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.