Skip to content

Commit

Permalink
Revert "chore: adjust 'packages/mail/src/mail.d.ts' (#1320)"
Browse files Browse the repository at this point in the history
This reverts commit a6a83d1.
  • Loading branch information
eshanholtz committed Jan 12, 2022
1 parent a6a83d1 commit 8126d72
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 17 deletions.
4 changes: 2 additions & 2 deletions packages/mail/src/mail.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,12 +32,12 @@ declare class MailService {
/**
* Send email
*/
send(data: MailDataRequired | MailDataRequired[], isMultiple?: boolean, cb?: (err: Error | ResponseError | null, result: [ClientResponse, {}]) => void): Promise<[ClientResponse, {}]>;
send(data: MailDataRequired | MailDataRequired[], isMultiple?: boolean, cb?: (err: Error | ResponseError, result: [ClientResponse, {}]) => void): Promise<[ClientResponse, {}]>;

/**
* Send multiple emails (shortcut)
*/
sendMultiple(data: MailDataRequired, cb?: (error: Error | ResponseError | null, result: [ClientResponse, {}]) => void): Promise<[ClientResponse, {}]>;
sendMultiple(data: MailDataRequired, cb?: (error: Error | ResponseError, result: [ClientResponse, {}]) => void): Promise<[ClientResponse, {}]>;
}

declare const mail: MailService;
Expand Down
15 changes: 0 additions & 15 deletions packages/mail/src/mail.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -47,21 +47,6 @@ describe('sgMail.send()', () => {
});
});

it('should not be null(error) in callBack function for unsuccessfully delivered emails', (done) => {
sgMail.send({}, false, (error, response) => {
expect(error).to.not.be.null();
done();
});
});

it('should be null(error) in callBack function for successfully delivered emails', (done) => {
sgClient.setDefaultHeader('X-Mock', 202);
sgMail.send(data, false, (error, response) => {
expect(error).to.be.null();
done();
});
});

it('should throw an error if callback is not a function', () => {
return expect(function() {
sgMail.send(data, false, {});
Expand Down

0 comments on commit 8126d72

Please sign in to comment.