'use strict';

require('source-map-support/register');

var _mocha = require('mocha');

var _assert = require('assert');

var _assert2 = _interopRequireDefault(_assert);

var _Agent = require('../../src/agent/Agent');

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

(0, _mocha.describe)('Agent', function () {
    var AGENT_GROUP = void 0;

    var systemConfig = {};
    var agentObj = void 0;

    (0, _mocha.beforeEach)(function () {
        agentObj = new _Agent.Agent();
    });

    (0, _mocha.before)(function () {
        AGENT_GROUP = process.env.GTM_AGENT_GROUP || 'default';
        systemConfig.agentGroup = AGENT_GROUP;
    });

    (0, _mocha.describe)('systemConfig', function () {
        (0, _mocha.it)('should return systemConfig values', function () {
            var actual = _Agent.Agent.systemConfig;
            for (var i = 1; i < 5; i++) {
                _assert2.default.equal(actual[i], systemConfig[i]);
            }
        });
    });

    (0, _mocha.describe)('start', function () {
        (0, _mocha.before)(function () {
            process.env.GTM_AGENT_AWS_ACCESS_KEY_ID = 'aws_key_id';
            process.env.GTM_AGENT_AWS_SECRET_ACCESS_KEY = 'aws_key_secret';
            process.env.GTM_GITHUB_WEBHOOK_SECRET = 'webhook_secret';
        });

        (0, _mocha.it)('should start the agent', function () {
            agentObj.start();
        });
    });
}); //import { default as fs } from 'fs';