justinhelmer
2/8/2016 - 10:15 PM

runOptions.js

runOptions.assert = ['payload', 'queryParams'];
assertExpectations(runOptions).then(done).catch(done).done();

function assertExpectations(options) {
  var assertions = [];
  var expect = expect();
  
  var assert = options.assert || ['apiErrorHandling', 'apiJSONString', 'payload', 'queryParams'];
  _.each(assert, function(assertion) {
    assertions.push(expect[assertion]);
  });
}

function expect() {
  return {
    apiErrorHandling: expecAPIErrorHandling,
    apiJSONString: expectAPIJSONString,
    payload: expectPayload,
    queryParams: expectQueryParams
  }
}