code: async function connectToServer(client, config) {
    return new Promise((resolve, reject) => {
      client
        .on('ready', error => (error ? reject(error) : resolve(client)))
        .on('error', error => reject(error))
        .connect(config);
    });
  }
docs: Create a connection to the server
  @returns {Promise<*>}