{"size": 571, "ext": "js", "max_stars_repo_path": "services/tests/e2e/wait-for.js", "max_stars_repo_name": "stephaniemelton/stitch", "max_stars_repo_stars_event_min_datetime": "2019-05-21T06:56:05.000Z", "max_stars_repo_stars_event_max_datetime": "2019-12-28T04:21:49.000Z", "max_issues_repo_path": "services/tests/e2e/wait-for.js", "max_issues_repo_name": "stephaniemelton/stitch", "max_issues_repo_issues_event_min_datetime": "2019-05-21T06:55:51.000Z", "max_issues_repo_issues_event_max_datetime": "2019-12-29T08:45:20.000Z", "max_forks_repo_path": "services/tests/e2e/wait-for.js", "max_forks_repo_name": "stephaniemelton/stitch", "max_forks_repo_forks_event_min_datetime": "2019-05-29T09:06:53.000Z", "max_forks_repo_forks_event_max_datetime": "2019-05-29T09:06:53.000Z"}
{"max_stars_count": 10, "max_issues_count": 49, "max_forks_count": 1, "avg_line_length": 27.1904761905, "max_line_length": 71, "alphanum_fraction": 0.7092819615}
const waitOn = require('wait-on');

async function waitForIt(resources, reverse = false, timeout = 10000) {
  await waitOn({
    resources,
    timeout,
    reverse,
    interval: 100,
    simultaneous: 1,
  });
}

const serviceUrls = [
  'http-get://localhost:8080/.well-known/apollo/server-health',
  'http-get://localhost:8090/.well-known/apollo/server-health',
  'http-get://localhost:8070/.well-known/openid-configuration',
];

module.exports.start = waitForIt.bind(undefined, serviceUrls, false);
module.exports.stop = waitForIt.bind(undefined, serviceUrls, true);
