Skip to content

Extends stretchr/testify/assert for add more useful methods.

License

Notifications You must be signed in to change notification settings

longbridge/assert

Repository files navigation

Assert

Go

🍯 Requirement Go 1.18+ for Generics, lower Go version please use 0.x

Extends stretchr/testify/assert for add more useful methods.

  • assert.Equal - asserts values equal, but ignore type.
  • assert.EqualHTML - asserts HTML equal, ignore spaces.

Installation

go get github.com/longbridge/assert

Usage

package some_test

import (
  "github.com/longbridge/assert"
)

func TestSomeMethod(t *testing.T) {
	assert.EqualHTML(t, "<p>Hello world</p><p>This is next line</p>", `
		<p>Hello world</p>
		<p>This is next line</p>
	`)
}

License

MIT