bin/sauceLabs.js
function (route, body, method = 'post') {
  return got(`https://saucelabs.com/rest/v1/${process.env.SAUCE_USERNAME}/${route}`, {
    method,
    json: true,
    body,
    headers: {
      Authorization: `Basic ${getCredentials()}`
    }
  }).then((response) => {
    return response.body
  }).catch((error) => {
    throw error.response.body
  })
}
function (route, body, method = 'post') {
  return got(`https://saucelabs.com/rest/v1/${process.env.SAUCE_USERNAME}/${route}`, {
    method,
    json: true,
    body,
    headers: {
      Authorization: `Basic ${getCredentials()}`
    }
  }).then((response) => {
    return response.body
  }).catch((error) => {
    throw error.response.body
  })
}
function ( route , body , method = 'post' ) { return got ( ` ${ process . env . SAUCE_USERNAME } ${ route } ` , { method , json : true , body , headers : { Authorization : ` ${ getCredentials ( ) } ` } } ) . then ( ( response ) => { return response . body } ) . catch ( ( error ) => { throw error . response . body } ) }
Makes an http request to sauceLabs

@method makeHttpRequest

@param  {String}        route
@param  {Object}        body
@param  {String}        [method = 'post']

@return {Promise}
Makes an http request to sauceLabs