From 44913c1668dda3ab80039d72933db60c0e97bf77 Mon Sep 17 00:00:00 2001 From: nimbleghost <132819643+nimbleghost@users.noreply.github.com> Date: Wed, 31 May 2023 18:02:04 +0200 Subject: [PATCH] Replace if err-nil-Fatal check with require.Nil --- server/server_web_push_test.go | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) diff --git a/server/server_web_push_test.go b/server/server_web_push_test.go index e6dda63e..0c8526b1 100644 --- a/server/server_web_push_test.go +++ b/server/server_web_push_test.go @@ -34,9 +34,7 @@ func TestServer_WebPush_TopicSubscribe(t *testing.T) { require.Equal(t, `{"success":true}`+"\n", response.Body.String()) subs, err := s.webPush.SubscriptionsForTopic("test-topic") - if err != nil { - t.Fatal(err) - } + require.Nil(t, err) require.Len(t, subs, 1) require.Equal(t, subs[0].BrowserSubscription.Endpoint, "https://example.com/webpush") @@ -185,16 +183,12 @@ func addSubscription(t *testing.T, s *Server, topic string, url string) { }, }, }) - if err != nil { - t.Fatal(err) - } + require.Nil(t, err) } func requireSubscriptionCount(t *testing.T, s *Server, topic string, expectedLength int) { subs, err := s.webPush.SubscriptionsForTopic("test-topic") - if err != nil { - t.Fatal(err) - } + require.Nil(t, err) require.Len(t, subs, expectedLength) }