is

Professional lightweight testing mini-framework for Go.

  • Owner: matryer/is
  • Platform:
  • License:: MIT License
  • Category::
  • Topic:
  • Like:
    0
      Compare:

Github stars Tracking Chart

is GoDoc Go Report Card Build Status

Professional lightweight testing mini-framework for Go.

  • Easy to write and read
  • Beautifully simple API 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:

Examples of failures

Usage

The following code shows a range of useful ways you can use
the helper methods:

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 IS_NO_COLOR=true.

go test -nocolor
IS_NO_COLOR=true go test

Main metrics

Overview
Name With Ownermatryer/is
Primary LanguageGo
Program languageGo (Language Count: 1)
Platform
License:MIT License
所有者活动
Created At2016-12-06 13:24:01
Pushed At2024-02-08 21:33:15
Last Commit At2023-05-03 17:13:49
Release Count6
Last Release Namev1.4.1 (Posted on )
First Release Namev1.0.0 (Posted on )
用户参与
Stargazers Count1.9k
Watchers Count23
Fork Count60
Commits Count97
Has Issues Enabled
Issues Count28
Issue Open Count7
Pull Requests Count24
Pull Requests Open Count0
Pull Requests Close Count7
项目设置
Has Wiki Enabled
Is Archived
Is Fork
Is Locked
Is Mirror
Is Private