Provides utilities used in integration tests.
Members
(static) baseUrl
Base URL for the HTTP requests.
Methods
(static) disableMocksAndShutdownServer() → {Promise}
Disables all of the mocking done previously and stops the server if it is running.
Returns:
- Type
- Promise
(static) dropDatabase() → {Promise}
Drops the MongoDB database.
Returns:
- Type
- Promise
(static) failUponHttpError(done, log) → {function}
A nice handler to use in Promise.catch. Pass this one to HTTP request promises.
Parameters:
Name | Type | Description |
---|---|---|
done |
Mocha's |
|
log |
If true, error will be logged |
Returns:
- Type
- function
(static) mockNecessaryThings() → {Promise}
Integration tests doesn't make sense for somethings. For example, Facebook integration. Unfortunately, Facebook doesn't provide debug tokes. So, any token hardcoded in here will be expired very soon. Thus, we mock the Facebook integration by returning a mock token to all long lived access token requests. Same goes to user profile information.
Returns:
- Type
- Promise
(static) startServerWithCleanDatabase() → {Promise}
Drops the database and starts the application (as in, listening on port N).
Returns:
- Type
- Promise