'use strict';

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

var _fs = require('fs');

var _fs2 = _interopRequireDefault(_fs);

var _mocha = require('mocha');

var _assert = require('assert');

var _assert2 = _interopRequireDefault(_assert);

var _Executor = require('../../src/agent/Executor');

var _ExecutorDockerServerless = require('../../src/executors/ExecutorDockerServerless');

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

(0, _mocha.describe)('ExecutorDockerServerless', function () {
    var executorDockerServerless = void 0;
    var eventData = void 0;
    process.env.GTM_DOCKER_ALLOW_PULL = 'false';

    (0, _mocha.beforeEach)(function () {
        eventData = JSON.parse(_fs2.default.readFileSync(__dirname + '/../fixtures/push.json', 'utf-8'));
        executorDockerServerless = new _ExecutorDockerServerless.ExecutorDockerServerless(eventData, console);
    });

    (0, _mocha.describe)('constructor', function () {
        (0, _mocha.it)('should instantiate as Executor', function () {
            _assert2.default.equal(executorDockerServerless instanceof _Executor.Executor, true);
        });
    });

    (0, _mocha.describe)('identifyChangedPackages', function () {
        (0, _mocha.it)('should find distinct packages', function () {
            var expected = ['lambdaAbc', 'lambdaDef', 'lambdaHij', 'lambdaKlm', 'lambdaOne', 'lambdaTwo', 'lambdaFour', 'lambdaThree'];

            var packages = executorDockerServerless.packagesToDeploy;
            _assert2.default.deepEqual(packages, expected);
        });
    });
});