Skip to content

Commit

Permalink
Merge pull request #324 from Secreto31126/typo
Browse files Browse the repository at this point in the history
fix: typo _authenicatedRequest
  • Loading branch information
Secreto31126 authored Apr 4, 2024
2 parents aef2308 + 5b4f731 commit 0b9d27d
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
4 changes: 2 additions & 2 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -646,7 +646,7 @@ export class WhatsAppAPI {
*/
fetchMedia(url: string): Promise<Response> {
// Hacky way to check if the url is valid and throw if invalid
return this._authenicatedRequest(new URL(url));
return this._authenticatedRequest(new URL(url));
}

/**
Expand Down Expand Up @@ -915,7 +915,7 @@ export class WhatsAppAPI {
* @returns The fetch response
* @throws If url is not specified
*/
_authenicatedRequest(url: string | URL | Request): Promise<Response> {
_authenticatedRequest(url: string | URL | Request): Promise<Response> {
// Keep the check to ensure on runtime that no weird stuff happens
if (!url) throw new Error("URL must be specified");

Expand Down
10 changes: 5 additions & 5 deletions test/index.test.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -1938,7 +1938,7 @@ describe("WhatsAppAPI", function () {
});
});

describe("_authenicatedRequest", function () {
describe("_authenticatedRequest", function () {
const Whatsapp = new WhatsAppAPI({
v,
token,
Expand All @@ -1960,20 +1960,20 @@ describe("WhatsAppAPI", function () {
.reply(200)
.times(1);

Whatsapp._authenicatedRequest("https://example.com/");
Whatsapp._authenticatedRequest("https://example.com/");
});

it("should fail if the url param is not defined", function () {
throws(function () {
Whatsapp._authenicatedRequest(undefined);
Whatsapp._authenticatedRequest(undefined);
});

throws(function () {
Whatsapp._authenicatedRequest(false);
Whatsapp._authenticatedRequest(false);
});

throws(function () {
Whatsapp._authenicatedRequest();
Whatsapp._authenticatedRequest();
});
});
});
Expand Down

0 comments on commit 0b9d27d

Please sign in to comment.