hapiest-deploy
Version:
A deployment tool. Initially for AWS ElasticBeanstalk but it may expand in scope over time.
52 lines (40 loc) • 2.13 kB
JavaScript
;
const Should = require('should');
const Path = require('path');
const DeployServiceFactory = require('../../lib/deployServiceFactory');
const DeployService = require('../../lib/deployService');
const logger = require('../helper/logger');
describe('DeployServiceFactory', function() {
describe('create', function() {
it('Should successfully create an instance of DeployService', function() {
/** @type {DeployCredentials} */
const credentials = require('../helper/unit-config/deployCredentials.json');
/** @type {DeployConfig} */
const config = require('../helper/unit-config/deployConfig.json');
const folders = {
config: Path.resolve(__dirname, '../helper/unit-config'),
apps: Path.resolve(__dirname, '../helper/unit-apps'),
gitRoot: Path.resolve(__dirname, '../helper/unit-repo')
};
const deployService = DeployServiceFactory.create(folders, logger);
Should.exist(deployService);
deployService.should.be.an.instanceOf(DeployService);
});
it('Should successfully create an instance of DeployService with preHookFunction provided', function() {
/** @type {DeployCredentials} */
const credentials = require('../helper/unit-config/deployCredentials.json');
/** @type {DeployConfig} */
const config = require('../helper/unit-config/deployConfig.json');
const folders = {
config: Path.resolve(__dirname, '../helper/unit-config'),
apps: Path.resolve(__dirname, '../helper/unit-apps'),
gitRoot: Path.resolve(__dirname, '../helper/unit-repo')
};
const preHookFunction = (info, deployRequest, logger) => { };
const deployService = DeployServiceFactory.create(folders, logger, preHookFunction);
Should.exist(deployService);
deployService.should.be.an.instanceOf(DeployService);
});
// @TODO: add test cases for invalid configurations
});
});