mirror of
https://github.com/d0zingcat/gocryptotrader.git
synced 2026-05-29 23:16:51 +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,7 +1,6 @@
|
||||
package ticker
|
||||
|
||||
import (
|
||||
"errors"
|
||||
"log"
|
||||
"math/rand"
|
||||
"os"
|
||||
@@ -293,9 +292,7 @@ func TestProcessTicker(t *testing.T) { // non-appending function to tickers
|
||||
Bid: 1338,
|
||||
Ask: 1336,
|
||||
})
|
||||
if !errors.Is(err, errBidGreaterThanAsk) {
|
||||
t.Errorf("received: %v but expected: %v", err, errBidGreaterThanAsk)
|
||||
}
|
||||
assert.ErrorIs(t, err, errBidGreaterThanAsk)
|
||||
|
||||
err = ProcessTicker(&Price{
|
||||
ExchangeName: "Bitfinex",
|
||||
|
||||
Reference in New Issue
Block a user