Add more unit tests

This commit is contained in:
Jamie Curnow committed 2023-07-28 15:01:54 +10:00
1 parent 7f9a1f5a98
commit e5ade3b4ea
11 files changed
+162 -83

No files matched your search

+1
View File
@@ -3,6 +3,7 @@ package serverevents
import (
"encoding/json"
"net/http"
"npm/internal/logger"
"github.com/jc21/go-sse"
+20
View File
@@ -0,0 +1,20 @@
package serverevents
import (
"testing"
"github.com/stretchr/testify/assert"
)
func TestGet(t *testing.T) {
s := Get()
assert.NotEqual(t, nil, s)
}
// This is just for code coverage more than anything
func TestEverything(t *testing.T) {
Get()
SendMessage("test", "test", map[string]string{"user_id": "10"})
SendChange("hosts")
Shutdown()
}