serverless/lib/plugins/awsDeploy/tests/initializeResources.js
Philipp Muens 6d2e67f21a Refactor awsDeploy to use new deploy lifecycles
The awsDeploy plugin now uses different lifecycles to split the tasks up and
introduce a way for 3rd party plugin developers to hook into those lifecycle to e.g.
add resources before everything is deployed.
2016-06-09 07:18:05 +02:00

32 lines
800 B
JavaScript

'use strict';
const expect = require('chai').expect;
const AwsDeploy = require('../awsDeploy');
const Serverless = require('../../../Serverless');
describe('#initializeResources()', () => {
const serverless = new Serverless();
const awsDeploy = new AwsDeploy(serverless);
it('should add core resources and merge custom resources', () => {
awsDeploy.options = {
stage: 'dev',
region: 'us-east-1',
};
awsDeploy.serverless.service.service = 'first-service';
awsDeploy.serverless.service.resources.aws = {
Resources: {
fakeResource: {
fakeProp: 'fakeValue',
},
},
};
awsDeploy.initializeResources();
expect(Object.keys(awsDeploy.serverless.service.resources
.aws.Resources).length).to.be.equal(4);
});
});