{"size": 695, "ext": "js", "max_stars_repo_path": "test/helper.js", "max_stars_repo_name": "chuhaienko/tests-AfterUber", "max_stars_repo_stars_event_min_datetime": "2018-12-16T18:55:30.000Z", "max_stars_repo_stars_event_max_datetime": "2018-12-16T18:55:30.000Z", "max_issues_repo_path": "test/helper.js", "max_issues_repo_name": "chuhaienko/tests-AfterUber", "max_issues_repo_issues_event_min_datetime": null, "max_issues_repo_issues_event_max_datetime": null, "max_forks_repo_path": "test/helper.js", "max_forks_repo_name": "chuhaienko/tests-AfterUber", "max_forks_repo_forks_event_min_datetime": null, "max_forks_repo_forks_event_max_datetime": null}
{"max_stars_count": 1, "max_issues_count": null, "max_forks_count": null, "avg_line_length": 19.3055555556, "max_line_length": 81, "alphanum_fraction": 0.6071942446}
'use strict';
process.env.NODE_ENV = 'test';

const {App}   = require('mif');
const request = require('request-promise');


const app = new App();
exports.app = app;

exports.start = async function () {
	await app.init();
	await app.start();
};

exports.stop = async function () {
	return app.stop();
};

exports.getUrl = function () {
	return `http://localhost:${app.modules['web-server'].netServer.address().port}`;
};

exports.request = function (method, path, body, auth) {
	return request({
		method: method,
		url:    `${exports.getUrl()}${path}`,
		body:   body,
		auth:   auth,

		json:                    true,
		simple:                  false,
		resolveWithFullResponse: true,
	});
};
