Skip to content

Commit

Permalink
chore: fixed linting
Browse files Browse the repository at this point in the history
  • Loading branch information
freak12techno committed Apr 29, 2024
1 parent 983159c commit 22fa4da
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 6 deletions.
6 changes: 4 additions & 2 deletions pkg/types/error_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ import (
"errors"
"testing"

"github.com/stretchr/testify/require"

"github.com/stretchr/testify/assert"
)

Expand Down Expand Up @@ -43,7 +45,7 @@ func TestJsonErrorMarshalJson(t *testing.T) {
jsonErr := JSONError{error: "error"}
value, err := jsonErr.MarshalJSON()

assert.NoError(t, err)
require.NoError(t, err)
assert.Equal(t, []byte("\"error\""), value)
}

Expand All @@ -53,7 +55,7 @@ func TestJsonErrorUnmarshalJson(t *testing.T) {
jsonErr := JSONError{}
err := jsonErr.UnmarshalJSON([]byte("error"))

assert.NoError(t, err)
require.NoError(t, err)
assert.Equal(t, "error", jsonErr.error)
}

Expand Down
11 changes: 7 additions & 4 deletions pkg/utils/utils_test.go
Original file line number Diff line number Diff line change
@@ -1,11 +1,14 @@
package utils

import (
"github.com/stretchr/testify/assert"
"main/pkg/constants"
"net/http"
"testing"
"time"

"github.com/stretchr/testify/require"

"github.com/stretchr/testify/assert"
)

func TestFilter(t *testing.T) {
Expand Down Expand Up @@ -60,7 +63,7 @@ func TestGetBlockFromHeaderNoValue(t *testing.T) {
header := http.Header{}
value, err := GetBlockHeightFromHeader(header)

assert.NoError(t, err)
require.NoError(t, err)
assert.Equal(t, int64(0), value)
}

Expand All @@ -72,7 +75,7 @@ func TestGetBlockFromHeaderInvalidValue(t *testing.T) {
}
value, err := GetBlockHeightFromHeader(header)

assert.Error(t, err)
require.Error(t, err)
assert.Equal(t, int64(0), value)
}

Expand All @@ -84,6 +87,6 @@ func TestGetBlockFromHeaderValidValue(t *testing.T) {
}
value, err := GetBlockHeightFromHeader(header)

assert.NoError(t, err)
require.NoError(t, err)
assert.Equal(t, int64(123), value)
}

0 comments on commit 22fa4da

Please sign in to comment.