Description

EqualError asserts that a function returned an error (i.e. not `nil`) and that it is equal to the provided error.

  actualObj, err := SomeFunction()
  if assert.Error(t, err, "An error was expected") {
	   assert.Equal(t, err, expectedError)
  }

Returns whether the assertion was successful (true) or not (false).

EqualError is referenced in 132 repositories

github.com/stretchr/testify github.com/rs/rest-layer github.com/Ayvan/iso8583

...