36

GitHub - axcdnt/snitch: Snitch is the tool that keeps your tests under surveille...

 4 years ago
source link: https://github.com/axcdnt/snitch
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.

Snitch

logo.png

Snitch is a binary that helps your TDD cycle (or not) by watching tests and implementations of Go files. It works by scanning files, checking the modification date on save and re-running your tests.

It's usual in Go projects to keep the implementation and tests under the same package, so this binary follows this convention.

This tool focuses on Go developers. With a few LOCs we get interesting stuff.

Inspiration

It was a Friday afternoon and I was writing code, but had nothing to watch and report my tests while I changed code.

Inspired by Guard, I decided to build this and thought more people could benefit from it.

Features

  • Automatically runs your tests
  • Re-scan new files, so no need to restart
  • Runs on a package basis
  • Shows test coverage percentage
  • Desktop notifications on macOS and Linux (via notify-send)

Requirements

Go 1.12+ heart

The binary is go-gettable. Make sure you have GOPATH correctly set and added to the $PATH:

go get github.com/axcdnt/snitch

After go-getting the binary, it will probably be available on your terminal.

▶ snitch --help
Usage of snitch:
  -interval duration
    	the interval (in seconds) for scanning files (default 1s)
  -path string
    	the root path to be watched (default "<current-dir>")
  -v    Print the current version and exit

Feedback is welcome. I hope you enjoy it!


Recommend

About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK