MCPcopy Index your code
hub / github.com/dnote/dnote / MustNewServer

Function MustNewServer

pkg/server/controllers/testutils.go:28–35  ·  view source on GitHub ↗

MustNewServer is a test utility function to initialize a new server with the given app

(t *testing.T, a *app.App)

Source from the content-addressed store, hash-verified

26// MustNewServer is a test utility function to initialize a new server
27// with the given app
28func MustNewServer(t *testing.T, a *app.App) *httptest.Server {
29 server, err := NewServer(a)
30 if err != nil {
31 t.Fatal(errors.Wrap(err, "initializing router"))
32 }
33
34 return server
35}
36
37func NewServer(a *app.App) (*httptest.Server, error) {
38 ctl := New(a)

Callers 15

TestGetNotesFunction · 0.85
TestGetNoteFunction · 0.85
TestCreateNoteFunction · 0.85
TestDeleteNoteFunction · 0.85
TestUpdateNoteFunction · 0.85
TestNotSupportedVersionsFunction · 0.85
TestGetBooksFunction · 0.85
TestGetBooksByNameFunction · 0.85
TestGetBookFunction · 0.85
TestGetBookNonOwnerFunction · 0.85
TestCreateBookFunction · 0.85
TestUpdateBookFunction · 0.85

Calls 1

NewServerFunction · 0.85

Tested by 15

TestGetNotesFunction · 0.68
TestGetNoteFunction · 0.68
TestCreateNoteFunction · 0.68
TestDeleteNoteFunction · 0.68
TestUpdateNoteFunction · 0.68
TestNotSupportedVersionsFunction · 0.68
TestGetBooksFunction · 0.68
TestGetBooksByNameFunction · 0.68
TestGetBookFunction · 0.68
TestGetBookNonOwnerFunction · 0.68
TestCreateBookFunction · 0.68
TestUpdateBookFunction · 0.68