Module: test/app-integration-helper-commons

Provides utilities used in integration tests.

Source:

Members

(static) baseUrl

Base URL for the HTTP requests.

Source:

Methods

(static) disableMocksAndShutdownServer() → {Promise}

Disables all of the mocking done previously and stops the server if it is running.

Source:
Returns:
Type
Promise

(static) dropDatabase() → {Promise}

Drops the MongoDB database.

Source:
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 done callback

log

If true, error will be logged

Source:
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.

Source:
Returns:
Type
Promise

(static) startServerWithCleanDatabase() → {Promise}

Drops the database and starts the application (as in, listening on port N).

Source:
Returns:
Type
Promise