{"size": 800, "ext": "js", "max_stars_repo_path": "test/server.test.js", "max_stars_repo_name": "agarcia-caicedo/telescope", "max_stars_repo_stars_event_min_datetime": null, "max_stars_repo_stars_event_max_datetime": null, "max_issues_repo_path": "test/server.test.js", "max_issues_repo_name": "agarcia-caicedo/telescope", "max_issues_repo_issues_event_min_datetime": "2021-02-04T04:44:08.000Z", "max_issues_repo_issues_event_max_datetime": "2021-02-08T17:35:36.000Z", "max_forks_repo_path": "test/server.test.js", "max_forks_repo_name": "agarcia-caicedo/telescope", "max_forks_repo_forks_event_min_datetime": null, "max_forks_repo_forks_event_max_datetime": null}
{"max_stars_count": null, "max_issues_count": 2, "max_forks_count": null, "avg_line_length": 34.7826086957, "max_line_length": 72, "alphanum_fraction": 0.66}
const request = require('supertest');
const app = require('../src/backend/web/app');

jest.mock('../src/backend/utils/elastic');

describe('Health Check', () => {
  it('should return a JSON object with property "status"', async () => {
    const res = await request(app).get('/health');
    expect(res.statusCode).toEqual(200);
    expect(res.body).toHaveProperty('status');
    expect(res.body.status).toEqual('ok');
  });

  it('should return a JSON object with property "info"', async () => {
    const res = await request(app).get('/health');
    expect(res.statusCode).toEqual(200);
    expect(res.body).toHaveProperty('info');
    expect(res.body.info).toHaveProperty('gitHubUrl');
    expect(res.body.info).toHaveProperty('sha');
    expect(res.body.info).toHaveProperty('version');
  });
});
