Reputation: 335
I am writing a simple service and was wondering how should I approach testing the REST API Endpoints using GoConvey?
Ideally I believe I would have to launch my server to test it against, but for some reason I am not able to wrap my head around on how to do it with Go.
I am using the vanilla net/http stack for this service and mgo for the database.
Any idea and help would be very welcomed :)
Thanks!
Upvotes: 1
Views: 682
Reputation: 1736
the net/http/httptest package is useful for creating a server for a specific http.Handler.
Andrew Gerrand's testing talk goes over the httptest.Server and httptest.ResponseRecorder starting slide 12
Upvotes: 0