1
0
Fork 0
mirror of https://github.com/binwiederhier/ntfy.git synced 2024-12-25 19:23:23 +01:00

Replace if err-nil-Fatal check with require.Nil

This commit is contained in:
nimbleghost 2023-05-31 18:02:04 +02:00
parent 20c7650e51
commit 44913c1668

View file

@ -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)
}