Docblocks, a handful of tests, but not enough

This commit is contained in:
Philipp Heckel 2021-12-19 14:27:26 -05:00
parent fa9d6444f5
commit e3dfea1991
9 changed files with 121 additions and 12 deletions

View file

@ -6,7 +6,6 @@ import (
"encoding/json"
"fmt"
"github.com/stretchr/testify/require"
"heckel.io/ntfy/config"
"net/http"
"net/http/httptest"
"os"
@ -393,13 +392,13 @@ func TestServer_PublishFirebase(t *testing.T) {
time.Sleep(500 * time.Millisecond) // Time for sends
}
func newTestConfig(t *testing.T) *config.Config {
conf := config.New(":80")
func newTestConfig(t *testing.T) *Config {
conf := NewConfig(":80")
conf.CacheFile = filepath.Join(t.TempDir(), "cache.db")
return conf
}
func newTestServer(t *testing.T, config *config.Config) *Server {
func newTestServer(t *testing.T, config *Config) *Server {
server, err := New(config)
if err != nil {
t.Fatal(err)