Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

Refactor tests to not send actual requests #48

Closed
theycallmeswift opened this Issue · 3 comments

2 participants

@theycallmeswift

There is really no need for us to send out actual requests in the tests. In the current format, you would have to manually open and check somewhere in the neighborhood of 40 emails. We can eliminate a lot of this overhead by mocking out the server and checking that the requests are made and in the format that SendGrid expects us to have.

This is labeled as urgent because the TravisCI build is broken until it is fixed and it's blocking a number of pending pull requests.

@theycallmeswift theycallmeswift referenced this issue from a commit
Commit has since been removed from the repository and is no longer available.
@theycallmeswift theycallmeswift referenced this issue from a commit
@theycallmeswift theycallmeswift Moved integration tests into skipped category
This is part of the larger issue #48.  In order to get a passing
TravisCI build, I moved all the integration tests into a skipped
category.  They can now be run with `npm run-script skipped`.
bd963aa
@theycallmeswift theycallmeswift referenced this issue from a commit
@theycallmeswift theycallmeswift Moved integration tests into skipped category
This is part of the larger issue #48.  In order to get a passing
TravisCI build, I moved all the integration tests into a skipped
category.  They can now be run with `npm run-script skipped`.

Closes #50
3fa2615
@theycallmeswift theycallmeswift referenced this issue from a commit
@theycallmeswift theycallmeswift Moved WebAPI tests to mocks instead of real requests.
Original integration tests sent out actual emails using credentials from
a config file.  Now they use a mocked http request to SendGrid and we
test that the request is what we would expect.

This is part of #48
b87315f
@theycallmeswift theycallmeswift referenced this issue from a commit
@theycallmeswift theycallmeswift Moved WebAPI tests to mocks instead of real requests.
Original integration tests sent out actual emails using credentials from
a config file.  Now they use a mocked http request to SendGrid and we
test that the request is what we would expect.

This is part of #48

Closes #49
8f8cfc5
@motdotla

This is actually completed already before I jumped in. Closing.

Additional note: commenting out SMTP = "STUB"; will allow the smtp tests at the very least to run for real.

@motdotla motdotla closed this
@theycallmeswift

I talked with Pedro (the author of nock) briefly about how to handle the SMTP stub stuff. His advice was just to stub the underlying sendMail function and to check that the parameters are what we would expect.

@motdotla

Ok, good call. Will do.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.