mirror of
https://github.com/d0zingcat/gocryptotrader.git
synced 2026-05-30 23:16:52 +00:00
codebase: Replace !errors.Is(err, target) with testify (#1931)
* tests: Replace !errors.Is(err, target) with testify equivalents * codebase: Manual !errors.Is(err, target) replacements * typo: Replace errMisMatchedEvent with errMismatchedEvent * tests: Enhance error messages for better output * tests: Refactor error assertions in various test cases to use require and improve clarity * misc linter: Fix assert should wording * tests: Simplify assertions in TestCreateSignals for clarity and conciseness * tests: Enhance assertion message in TestCreateSignals
This commit is contained in:
@@ -1,9 +1,10 @@
|
||||
package fill
|
||||
|
||||
import (
|
||||
"errors"
|
||||
"testing"
|
||||
"time"
|
||||
|
||||
"github.com/stretchr/testify/assert"
|
||||
)
|
||||
|
||||
// TestSetup tests the setup function of the Fills struct
|
||||
@@ -28,9 +29,7 @@ func TestUpdateDisabledFeed(t *testing.T) {
|
||||
|
||||
// Send a test data to the Update function
|
||||
testData := Data{Timestamp: time.Now(), Price: 15.2, Amount: 3.2}
|
||||
if err := fill.Update(testData); !errors.Is(err, ErrFeedDisabled) {
|
||||
t.Errorf("Expected ErrFeedDisabled, got %v", err)
|
||||
}
|
||||
assert.ErrorIs(t, fill.Update(testData), ErrFeedDisabled)
|
||||
|
||||
select {
|
||||
case <-channel:
|
||||
|
||||
Reference in New Issue
Block a user