1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43
|
# is [](http://godoc.org/github.com/matryer/is) [](https://goreportcard.com/report/github.com/matryer/is) [](https://travis-ci.org/matryer/is)
Professional lightweight testing mini-framework for Go.
* Easy to write and read
* [Beautifully simple API](https://pkg.go.dev/github.com/matryer/is) with everything you need: `is.Equal`, `is.True`, `is.NoErr`, and `is.Fail`
* Use comments to add descriptions (which show up when tests fail)
Failures are very easy to read:

### Usage
The following code shows a range of useful ways you can use
the helper methods:
```go
func Test(t *testing.T) {
is := is.New(t)
signedin, err := isSignedIn(ctx)
is.NoErr(err) // isSignedIn error
is.Equal(signedin, true) // must be signed in
body := readBody(r)
is.True(strings.Contains(body, "Hi there"))
}
```
## Color
To turn off the colors, run `go test` with the `-nocolor` flag,
or with the env var [`NO_COLOR` (with any value)](https://no-color.org).
```
go test -nocolor
```
```
NO_COLOR=1 go test
```
|