jsonRequest
Description
This package was made for quickly and easily creating json requests for use in testing (in particular with GoFiber).
Usage
Creating a request
person := Person{
Name: "John Doe",
Age: 42,
}
// First value is the path, second is the body
req, _ := jsonRequest.PostJsonReq("/", person)
app.test(req)
Expect(resp.StatusCode).To(Equal(http.StatusCreated))
Note: gomega is used to compare status codes and app is an instance of a fiber app.