javaScriptHttpErrorEndpoint returns a callable function to setup an HTTP endpoint that always return StatusInternalServerError and a teardown function to terminate the underlying httptest server instance.
()
| 1661 | // return StatusInternalServerError and a teardown function to terminate the underlying httptest |
| 1662 | // server instance. |
| 1663 | func javaScriptHttpErrorEndpoint() func() (path string, teardownFn func()) { |
| 1664 | return func() (path string, teardownFn func()) { |
| 1665 | ts := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { |
| 1666 | w.WriteHeader(http.StatusInternalServerError) |
| 1667 | })) |
| 1668 | teardownFn = func() { ts.Close() } |
| 1669 | return ts.URL, teardownFn |
| 1670 | } |
| 1671 | } |
| 1672 | |
| 1673 | // javaScriptHttpsEndpoint returns a callable function to setup an HTTPS endpoint that exposes |
| 1674 | // the given JavaScript source and returns a teardown function to terminate the underlying |
no test coverage detected