Skip to content
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

test(email.service.ts): unit tests for email service #145

Merged
merged 1 commit into from
Jul 18, 2020

Conversation

alejandrosaenz117
Copy link
Collaborator

Pull Request

Thank you for your contribution to the Bulwark. Please include a summary of the change and which issue is fixed. Please also include relevant motivation and context. List any dependencies that are required for this change.

Fixes #136

Type of change

  • A new feature
  • A bug fix
  • Documentation only changes
  • Changes that do not affect the meaning of the code (white-space, formatting, missing semi-colons, etc)
  • A code change that neither fixes a bug nor adds a feature
  • A code change that improves performance
  • Adding missing tests or correcting existing tests
  • Changes that affect the build system or external dependencies
  • Changes to our CI configuration files and scripts
  • Other changes that don't modify src or test files

Checklist

  • My code follows the contributing guidelines of this project
  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes
  • Any dependent changes have been merged and published in downstream modules

@alejandrosaenz117
Copy link
Collaborator Author

@DarrellRichards Please review when you have a free chance! thanks!

Copy link
Contributor

@DarrellRichards DarrellRichards left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Other than just maybe some reuseable code. Everything else looks like and the code coverage on the backend is starting to look great 🔥 🚀 🎸

import * as emailService from './email.service';

describe('email service', () => {
test('send email failure missing credentials', async () => {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@Whamo12

Something you could do to reuse code would be to put the userEmail, uuid & spy all into a beforeAll

Ex:

let uuid;
let userEmail;
let spy;
BeforeAll(() => {
   // 
  // 
  //
}

@alejandrosaenz117 alejandrosaenz117 merged commit d3f42a0 into develop Jul 18, 2020
@alejandrosaenz117 alejandrosaenz117 deleted the 136-email branch July 30, 2020 13:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants