Skip to content

Commit

Permalink
Mark the callback as optional
Browse files Browse the repository at this point in the history
Without callback, it is impossible to unit-test the backbeat
routes, as we run async code and do not yet support promises.

Issue: CLDSRV-591
  • Loading branch information
williamlardier committed Dec 10, 2024
1 parent 22668de commit f2523ac
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion lib/routes/routeBackbeat.js
Original file line number Diff line number Diff line change
Expand Up @@ -1310,7 +1310,8 @@ const indexingSchema = joi.array().items(indexEntrySchema).min(1);

function respondToRequest(err, response, log, callback) {
responseJSONBody(err, null, response, log);
return callback(err);
// The callback is optional, as it is only used for testing purposes
return callback?.(err);
}

function routeIndexingAPIs(request, response, userInfo, log, callback) {
Expand Down

0 comments on commit f2523ac

Please sign in to comment.