Tests: Add unit tests

This commit is contained in:
graciousgrey
2024-04-29 18:36:39 +02:00
parent 020e9e7e19
commit 43011da182
3 changed files with 78 additions and 0 deletions

View File

@@ -0,0 +1,16 @@
package api
import (
"errors"
"testing"
"github.com/stretchr/testify/assert"
)
func TestNewResponse(t *testing.T) {
t.Run("404", func(t *testing.T) {
r := NewResponse(404, errors.New("not found"), "details")
assert.Equal(t, 404, r.Code)
assert.Equal(t, "details", r.Details)
})
}