Add more unit tests

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

View File

@ -3,6 +3,7 @@ package serverevents
import (
"encoding/json"
"net/http"
"npm/internal/logger"
"github.com/jc21/go-sse"

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