Skip to content

Commit ae7818d

Browse files
committed
fix: update verifyDiscordBot tests to remove unused response object
1 parent 966ef93 commit ae7818d

File tree

2 files changed

+4
-9
lines changed

2 files changed

+4
-9
lines changed

middlewares/authorizeBot.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ const verifyDiscordBot = async (req, res, next) => {
2020
try {
2121
const token = req.headers.authorization.split(" ")[1];
2222
const serviceName = req.headers[HEADERS.SERVICE_NAME] || "";
23+
2324
if (serviceName === DISCORD_SERVICE) {
2425
const data = botVerifcation.verifyDiscordService(token);
2526
if (data.name !== DISCORD_SERVICE) {

test/unit/middlewares/authorizeBot.test.js

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -184,9 +184,7 @@ describe("Middleware | Authorize Bot", function () {
184184
},
185185
};
186186

187-
const response = {};
188-
189-
authorizeBot.verifyDiscordBot(request, response, nextSpy);
187+
authorizeBot.verifyDiscordBot(request, {}, nextSpy);
190188
expect(nextSpy.calledOnce).to.be.equal(true);
191189
});
192190

@@ -199,9 +197,7 @@ describe("Middleware | Authorize Bot", function () {
199197
},
200198
};
201199

202-
const response = {};
203-
204-
authorizeBot.verifyDiscordBot(request, response, nextSpy);
200+
authorizeBot.verifyDiscordBot(request, {}, nextSpy);
205201
expect(nextSpy.calledOnce).to.be.equal(true);
206202
});
207203

@@ -234,9 +230,7 @@ describe("Middleware | Authorize Bot", function () {
234230
},
235231
};
236232

237-
const response = {};
238-
239-
authorizeBot.verifyDiscordBot(request, response, nextSpy);
233+
authorizeBot.verifyDiscordBot(request, {}, nextSpy);
240234
expect(nextSpy.calledOnce).to.be.equal(false);
241235
});
242236
});

0 commit comments

Comments
 (0)