-
Notifications
You must be signed in to change notification settings - Fork 0
Email and slack #8
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Conversation
| response = await sendSlackNotification(); | ||
| }); | ||
|
|
||
| it('requests the correct domain', () => expect(requestUrl).toBe(url)); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
expect(requestUrl).toBe(url);
expect(response.status).toBe(200);
expect(requestBody.channel).toBe(channel);
expect(requestBody.text).toBe(text);
| /** | ||
| * @TJS-type email | ||
| */ | ||
| to: string[]; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
pls add description
| console.log(`Failed to send Slack message: Received ${res.status} ${ res.statusText }` ) | ||
| Promise.reject(new Error('Failed to send Slack message')) | ||
| } | ||
| return Promise.resolve(res); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
what?
| @@ -0,0 +1,8 @@ | |||
| { | |||
| "extends":[ | |||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What?
containers/email/src/sendEmail.ts
Outdated
| export function checkWithinAttachmentLimit (filepaths: string[], limit: number) { | ||
| const getFileSize = (filepath: string) => stat(filepath).then((stats) => stats.size); | ||
|
|
||
| return Bluebird.map(filepaths, getFileSize) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If you wanted to use Ramda
const getFileSize = (filepath: string) => stat(filepath).then((stats) => stats.size);
const getFilesSize = (filePaths: string[]) => pipeP(map(getFileSize), sum)(filepaths)
const checkWithinAttachmentLimit = (filepaths: string[], limit: number) => getFilesSize(filePaths) < limit
No description provided.