Skip to content

Commit da11489

Browse files
committed
Await validateWebhook in tests
1 parent 8dc2960 commit da11489

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

index.test.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -1177,7 +1177,7 @@ describe("Replicate client", () => {
11771177
// This is a test secret and should not be used in production
11781178
const secret = "whsec_MfKQ9r8GKYqrTwjUPD8ILPZIo2LaLaSw";
11791179

1180-
const isValid = validateWebhook(request, secret);
1180+
const isValid = await validateWebhook(request, secret);
11811181
expect(isValid).toBe(true);
11821182
});
11831183

lib/util.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ const ApiError = require("./error");
2626
/**
2727
* Validate a webhook signature
2828
*
29-
* @returns {boolean} - True if the signature is valid
29+
* @returns {Promise<boolean>} - True if the signature is valid
3030
* @throws {Error} - If the request is missing required headers, body, or secret
3131
*/
3232
async function validateWebhook(requestData, secret) {

0 commit comments

Comments
 (0)