Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 13d6dd9

Browse files
committed
improve testing coverage
1 parent e26f5e1 commit 13d6dd9

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

coderd/httpmw/provisionerdaemon_test.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -134,10 +134,11 @@ func TestExtractProvisionerDaemonAuthenticated(t *testing.T) {
134134
r.Header.Set(codersdk.ProvisionerDaemonPSK, test.provisionerPSK)
135135
}
136136

137-
httpmw.ExtractProvisionerDaemonAuthenticated(test.opts)(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
137+
httpmw.ExtractProvisionerDaemonAuthenticated(test.opts)(http.HandlerFunc(func(w http.ResponseWriter, _ *http.Request) {
138138
w.WriteHeader(http.StatusOK)
139139
})).ServeHTTP(res, r)
140140

141+
//nolint:bodyclose
141142
require.Equal(t, test.expectedStatusCode, res.Result().StatusCode)
142143
if test.expectedResponseMessage != "" {
143144
require.Contains(t, res.Body.String(), test.expectedResponseMessage)
@@ -215,5 +216,4 @@ func TestExtractProvisionerDaemonAuthenticated(t *testing.T) {
215216
// require.Equal(t, http.StatusUnauthorized, res.Result().StatusCode)
216217
// require.Contains(t, res.Body.String(), "provisioner daemon key invalid")
217218
// })
218-
219219
}

0 commit comments

Comments
 (0)