From c8aed6b0ecc2e60cb31e7169cfd57eaf3ccb6dd7 Mon Sep 17 00:00:00 2001 From: Bryan Boreham Date: Sun, 28 Apr 2024 20:03:51 +0100 Subject: [PATCH] tests: API: Let nil expected response mean skip check When we want to check just the json encoding. Signed-off-by: Bryan Boreham --- web/api/v1/api_test.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/web/api/v1/api_test.go b/web/api/v1/api_test.go index dae408bcab..044cd171db 100644 --- a/web/api/v1/api_test.go +++ b/web/api/v1/api_test.go @@ -2892,7 +2892,9 @@ func testEndpoints(t *testing.T, api *API, tr *testTargetRetriever, es storage.E if test.zeroFunc != nil { test.zeroFunc(res.data) } - assertAPIResponse(t, res.data, test.response) + if test.response != nil { + assertAPIResponse(t, res.data, test.response) + } } if test.responseAsJSON != "" {