Documentation ¶
Overview ¶
Package testutil contains helper functions for writing tests
Index ¶
- Variables
- func ConvertResponseToRequest(t *testing.T, w *httptest.ResponseRecorder) *http.Request
- func Getenv(key string) string
- func HasBody(w *httptest.ResponseRecorder) bool
- func NewGet(path string, values url.Values) (*httptest.ResponseRecorder, *http.Request)
- func NewPost(path string, values url.Values) (*httptest.ResponseRecorder, *http.Request)
- func NewRequest(path string, values url.Values) *http.Request
- func ResponseOK(w *httptest.ResponseRecorder) bool
Constants ¶
This section is empty.
Variables ¶
View Source
var ( // testutil.RootDir will point to wherever this project's root directory is located on the user's computer RootDir = filepath.Join(filepath.Dir(f), ".."+string(os.PathSeparator)+"..") + string(os.PathSeparator) )
Functions ¶
func HasBody ¶ added in v0.1.0
func HasBody(w *httptest.ResponseRecorder) bool
func ResponseOK ¶ added in v0.1.0
func ResponseOK(w *httptest.ResponseRecorder) bool
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.