Documentation ¶
Overview ¶
package testUtils contains useful functions for writing tests
Index ¶
Constants ¶
View Source
const (
DBName = "test"
)
Variables ¶
View Source
var MockData []byte
View Source
var MockHandlerSuccess bool = false
flag to mark if MockHandler was reached. Used by the caller to check if the middleware being tested called the next middleware successfully
Functions ¶
func DeleteTestDB ¶
func DeleteTestDB(dbName string)
func MockHandler ¶
func MockHandler() func(w http.ResponseWriter, r *http.Request)
Types ¶
type MockResponseWriter ¶
mock response writer object and mock implementations of its methods
func NewMockResponseWriter ¶
func NewMockResponseWriter() *MockResponseWriter
func (MockResponseWriter) Header ¶
func (w MockResponseWriter) Header() http.Header
func (MockResponseWriter) WriteHeader ¶
func (w MockResponseWriter) WriteHeader(statusCode int)
Click to show internal directories.
Click to hide internal directories.