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?
已存檔?
是復刻?
已鎖定?
是鏡像?
是私有?