1
0
Fork 0
mirror of synced 2024-09-15 16:59:43 +12:00
budibase/packages/server/__mocks__/@sendgrid/mail.ts

24 lines
421 B
TypeScript
Raw Normal View History

2024-03-21 00:46:39 +13:00
// eslint-disable-next-line @typescript-eslint/no-unused-vars
module SendgridMock {
class Email {
constructor() {
// @ts-ignore
this.apiKey = null
}
setApiKey(apiKey: any) {
// @ts-ignore
this.apiKey = apiKey
}
async send(msg: any) {
if (msg.to === "invalid@example.com") {
throw "Invalid"
}
return msg
}
}
module.exports = new Email()
}