{"size": 484, "ext": "js", "max_stars_repo_path": "src/merchant/utils/__tests__/expressUtils.test.js", "max_stars_repo_name": "uber/uber-pay-reference-app", "max_stars_repo_stars_event_min_datetime": "2020-01-24T15:32:32.000Z", "max_stars_repo_stars_event_max_datetime": "2022-03-03T17:57:50.000Z", "max_issues_repo_path": "src/merchant/utils/__tests__/expressUtils.test.js", "max_issues_repo_name": "uber/uber-pay-reference-app", "max_issues_repo_issues_event_min_datetime": null, "max_issues_repo_issues_event_max_datetime": null, "max_forks_repo_path": "src/merchant/utils/__tests__/expressUtils.test.js", "max_forks_repo_name": "uber/uber-pay-reference-app", "max_forks_repo_forks_event_min_datetime": "2021-04-23T10:49:08.000Z", "max_forks_repo_forks_event_max_datetime": "2021-04-23T10:49:08.000Z"}
{"max_stars_count": 7, "max_issues_count": null, "max_forks_count": 1, "avg_line_length": 22.0, "max_line_length": 70, "alphanum_fraction": 0.6239669421}
const expressUtils = require('../expressUtils');

test('bad request util', () => {
  const mockResponse = {
    statusCode: 0,
    statusText: '',
    status(s) {
      this.statusCode = s;
      return this;
    },
    send() { return this; },
  };

  const errorCode = 400;
  const value = { error: 'test error' };

  const res = expressUtils.badRequest(mockResponse, value, errorCode);

  expect(res.statusCode).toBe(400);
  expect(res.statusText).toBe(JSON.stringify(value));
});
