New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

zuern.dev/is

Package Overview
Dependencies
Alerts
File Explorer
Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

zuern.dev/is

  • v0.0.2
  • Go
  • Socket score

Version published
Created
Source

is GoDoc Go Report Card

Professional lightweight testing mini-framework for Go.

This is a fork of https://github.com/matryer/is, which adds support for supplying a message failed tests as an arg or as a comment.

Features

  • Easy to write and read
  • Beautifully simple API with everything you need: is.Equal, is.True, is.NoErr, and is.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")) // Should be in body
}

Color

To turn off the colors, run go test with the -nocolor flag, or with the env var NO_COLOR (with any value).

go test -nocolor
NO_COLOR=1 go test

FAQs

Package last updated on 26 Feb 2024

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc