is

Professional lightweight testing mini-framework for Go.

  • 所有者: matryer/is
  • 平台:
  • 许可证: MIT License
  • 分类:
  • 主题:
  • 喜欢:
    0
      比较:

Github星跟踪图

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

主要指标

概览
名称与所有者matryer/is
主编程语言Go
编程语言Go (语言数: 1)
平台
许可证MIT License
所有者活动
创建于2016-12-06 13:24:01
推送于2024-02-08 21:33:15
最后一次提交2023-05-03 17:13:49
发布数6
最新版本名称v1.4.1 (发布于 )
第一版名称v1.0.0 (发布于 )
用户参与
星数1.9k
关注者数23
派生数60
提交数97
已启用问题?
问题数28
打开的问题数7
拉请求数24
打开的拉请求数0
关闭的拉请求数7
项目设置
已启用Wiki?
已存档?
是复刻?
已锁定?
是镜像?
是私有?