Documentation ¶
Index ¶
- func MakeAPIServer(t *testing.T, urlPath, ref, fixture string) *httptest.Server
- func MakeHookRequest(t *testing.T, fixture, eventType string, changes ...fixtureFunc) *http.Request
- func ReadJSONFixture(t *testing.T, filename string) map[string]interface{}
- func UnmarshalJSON(t *testing.T, b []byte) map[string]interface{}
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func MakeAPIServer ¶
MakeAPIServer is used during testing to create an HTTP server to return fixtures if the request matches.
func MakeHookRequest ¶
MakeHookRequest creates and returns a new http.Request that resembles a GitHub hook request, including the correct event type and reading and sending a fixture as a JSON body.
Optionally changes can be applied to the fixture that is read, before it's sent. TODO use uuid to generate the Delivery ID.
func ReadJSONFixture ¶
ReadJSONFixture reads a filename into a map, and fails the test if it is unable to open or parse the file.
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.