Skip to content

Commit

Permalink
Add WrapIfError test
Browse files Browse the repository at this point in the history
  • Loading branch information
dimriou committed Dec 20, 2023
1 parent 87231db commit 32aed04
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions pkg/utils/utils_test.go
Original file line number Diff line number Diff line change
@@ -1,15 +1,27 @@
package utils_test

import (
"errors"
"sync"
"testing"
"time"

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

"github.com/smartcontractkit/chainlink-common/pkg/utils"
)

func TestWrapIfError(t *testing.T) {
t.Parallel()

t.Run("wraps error", func(t *testing.T) {
err := errors.New("this is an error")
utils.WrapIfError(&err, "wrapped message")
assert.Equal(t, "wrapped message: this is an error", err.Error())
})
}

func TestAllEqual(t *testing.T) {
t.Parallel()

Expand Down

0 comments on commit 32aed04

Please sign in to comment.