toSucceed =
  (expCode = 200) =>
  (res) => {
    if (res.statusCode !== expCode) {
      console.log(res.text);
      throw new Error(`Expected status ${expCode}, received ${res.statusCode}`);
    }
  }
@param {number} expCode
@returns {void}
@throws {Error}