Skip to content

Commit

Permalink
Fix issues reported by testifylint
Browse files Browse the repository at this point in the history
  • Loading branch information
deining authored and sagikazarmark committed Jan 9, 2025
1 parent a5ea569 commit e75c48f
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion internal/encoding/json/codec_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ func TestCodec_Encode(t *testing.T) {
b, err := codec.Encode(data)
require.NoError(t, err)

assert.Equal(t, encoded, string(b))
assert.JSONEq(t, encoded, string(b))
}

func TestCodec_Decode(t *testing.T) {
Expand Down
8 changes: 4 additions & 4 deletions viper_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -477,7 +477,7 @@ func TestDefault(t *testing.T) {
v.SetConfigType("yaml")
err := v.ReadConfig(bytes.NewBuffer(yamlExample))

assert.NoError(t, err)
require.NoError(t, err)
assert.Equal(t, "leather", v.Get("clothing.jacket"))
}

Expand Down Expand Up @@ -1621,7 +1621,7 @@ func TestWrongDirsSearchNotFound(t *testing.T) {
v.AddConfigPath(`thispathaintthere`)

err := v.ReadInConfig()
assert.IsType(t, err, ConfigFileNotFoundError{"", ""})
assert.IsType(t, ConfigFileNotFoundError{"", ""}, err)

// Even though config did not load and the error might have
// been ignored by the client, the default still loads
Expand Down Expand Up @@ -1920,7 +1920,7 @@ func TestSafeWriteConfig(t *testing.T) {
require.NoError(t, v.SafeWriteConfig())
read, err := afero.ReadFile(fs, testutil.AbsFilePath(t, "/test/c.yaml"))
require.NoError(t, err)
assert.Equal(t, yamlWriteExpected, read)
assert.YAMLEq(t, string(yamlWriteExpected), string(read))
}

func TestSafeWriteConfigWithMissingConfigPath(t *testing.T) {
Expand Down Expand Up @@ -2501,7 +2501,7 @@ func TestKeyDelimiter(t *testing.T) {

var actual config

assert.NoError(t, v.Unmarshal(&actual))
require.NoError(t, v.Unmarshal(&actual))

assert.Equal(t, expected, actual)
}
Expand Down

0 comments on commit e75c48f

Please sign in to comment.