Skip to content

Commit

Permalink
test(logging): clean up some minor oopsies (#976)
Browse files Browse the repository at this point in the history
  • Loading branch information
KellyMerrick authored Sep 27, 2023
1 parent 5b1c83e commit 658e748
Showing 1 changed file with 1 addition and 7 deletions.
8 changes: 1 addition & 7 deletions router/middleware/logger_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -250,9 +250,7 @@ func TestMiddleware_Format(t *testing.T) {

got, err := formatter.Format(entry)

fmt.Println("got:", string(got))
// run test
gotLabels := string(formatter.DataKey)

if err != nil {
t.Errorf("Format returned err: %v", err)
Expand All @@ -262,16 +260,12 @@ func TestMiddleware_Format(t *testing.T) {
t.Errorf("Format returned nothing, want a log")
}

if !reflect.DeepEqual(gotLabels, wantLabels) {
t.Errorf("Logger returned %v, want %v", gotLabels, wantLabels)
}

if !strings.Contains(string(got), "GET") {
t.Errorf("Format returned %v, want to contain GET", string(got))
}

if !strings.Contains(string(got), "/foobar") {
t.Errorf("Format returned %v, want to contain GET", string(got))
t.Errorf("Format returned %v, want to contain /foobar", string(got))
}

}

0 comments on commit 658e748

Please sign in to comment.