Skip to content

Commit 5ab0bc1

Browse files
committed
fix unit tests
1 parent 750246c commit 5ab0bc1

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

Diff for: internal/config/read_test.go

+1-2
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ server:
6868
t.Run("Invalid file path", func(t *testing.T) {
6969
config := &Config{}
7070
err := config.Read("path/to/non_existent.yaml")
71-
assert.Nil(t, err)
71+
assert.EqualError(t, err, "Failed to read config file: open path/to/non_existent.yaml: no such file or directory")
7272
})
7373

7474
t.Run("Invalid YAML", func(t *testing.T) {
@@ -86,7 +86,6 @@ server:
8686
// Run the test
8787
cfg := &Config{}
8888
err = cfg.Read(filePath.Name())
89-
assert.Error(t, err) // We expect an error because the file has incorrect content
9089
assert.EqualError(t, err, "Failed to unmarshal config file: 1 error(s) decoding:\n\n* cannot parse 'server.api.skipInsecureVerify' as bool: strconv.ParseBool: parsing \"not_a_boolean\": invalid syntax")
9190
})
9291
}

0 commit comments

Comments
 (0)