diff options
| author | mo khan <mo@mokhan.ca> | 2025-04-12 18:11:05 -0600 |
|---|---|---|
| committer | mo khan <mo@mokhan.ca> | 2025-04-12 18:11:05 -0600 |
| commit | 0bef608297d7def2a18d054e7230fe0e0a3710a7 (patch) | |
| tree | 93a8ec34baa695705832ace22266e1f13cb9e64e /app/app_test.go | |
| parent | 54715831a2d307390c05214b6ae8bc721ade6680 (diff) | |
Diffstat (limited to 'app/app_test.go')
| -rw-r--r-- | app/app_test.go | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/app/app_test.go b/app/app_test.go new file mode 100644 index 0000000..d54397e --- /dev/null +++ b/app/app_test.go @@ -0,0 +1,32 @@ +package app + +import ( + "net/http" + "net/http/httptest" + "testing" + + "github.com/stretchr/testify/assert" + "gitlab.com/mokhax/sparkled/pkg/test" +) + +func TestApp(t *testing.T) { + t.Run("New", func(t *testing.T) { + server := New() + + t.Run("GET /index.html", func(t *testing.T) { + t.Skip() + response := httptest.NewRecorder() + + server.ServeHTTP(response, test.Request("GET", "/")) + assert.Equal(t, http.StatusOK, response.Code) + assert.Contains(t, response.Body.String(), "SparkleLab") + }) + + t.Run("GET /health", func(t *testing.T) { + response := httptest.NewRecorder() + + server.ServeHTTP(response, test.Request("GET", "/health")) + assert.Equal(t, http.StatusOK, response.Code) + }) + }) +} |
