Skip to content

Commit

Permalink
Manually set the empty object return
Browse files Browse the repository at this point in the history
  • Loading branch information
asein-sinch committed Dec 12, 2024
1 parent e4f37b3 commit 37bd4a1
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ export class EmailsApiFixture implements Partial<Readonly<EmailsApi>> {
/**
* Fixture associated to function purgeSendingQueue
*/
public purgeSendingQueue: jest.Mock<Promise<void>, [string, MailgunStorageHostname]> = jest.fn();
public purgeSendingQueue: jest.Mock<Promise<Record<string, never>>, [string, MailgunStorageHostname]> = jest.fn();
/**
* Fixture associated to function getSendingQueuesStatus
*/
Expand Down
4 changes: 3 additions & 1 deletion packages/mailgun/src/rest/v1/emails/emails-api.ts
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ export class EmailsApi extends MailgunDomainApi {
public async purgeSendingQueue(
domainName: string,
storageHostname: MailgunStorageHostname,
): Promise<void> {
): Promise<Record<string, never>> {
this.client = this.getSinchClient();
const getParams = {};
const headers: { [key: string]: string | undefined } = {
Expand All @@ -156,6 +156,8 @@ export class EmailsApi extends MailgunDomainApi {
apiName: this.apiName,
operationId: 'purgeSendingQueue',
});

return {};
}

/**
Expand Down
2 changes: 1 addition & 1 deletion packages/mailgun/tests/rest/v1/emails/emails-api.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ describe('EmailsApi', () => {
// Given
const domainName: string = 'domainName';
const storageHostname: MailgunStorageHostname = 'storageHostname';
const expectedResponse: void = undefined;
const expectedResponse: Record<string, never> = {};

// When
fixture.purgeSendingQueue.mockResolvedValue(expectedResponse);
Expand Down
2 changes: 1 addition & 1 deletion packages/mailgun/tests/rest/v1/emails/emails.steps.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ let sendEmailResponse: Mailgun.SendEmailResponse;
let sendMimeEmailResponse: Mailgun.SendEmailResponse;
let getEmailResponse: Mailgun.GetStoredEmailResponse;
let sendingQueuesStatusResponse: Mailgun.SendingQueuesStatusResponse;
let purgeSendingQueueResponse: void;
let purgeSendingQueueResponse: Record<string, never>;
const domainName = 'sandbox123.mailgun.org';

Given('the Mailgun service "Emails" is available', () => {
Expand Down

0 comments on commit 37bd4a1

Please sign in to comment.