mirror of
https://github.com/serverless/serverless.git
synced 2026-01-18 14:58:43 +00:00
Remove validations for existence of compiledCloudFormationTemplate
Because it's already available at the beginning of the deploy plugin as the core CloudFormation template will be attached there (which is then used to merge other resources into it later on).
This commit is contained in:
parent
9fadb31d0b
commit
919caa8f91
@ -5,11 +5,6 @@ const BbPromise = require('bluebird');
|
||||
|
||||
module.exports = {
|
||||
validate() {
|
||||
if (!this.serverless.service.provider.compiledCloudFormationTemplate) {
|
||||
throw new this.serverless.classes
|
||||
.Error('This plugin needs access to the compiled CloudFormation template');
|
||||
}
|
||||
|
||||
// validate that path and method exists for each http event in service
|
||||
_.forEach(this.serverless.service.functions, (functionObject, functionName) => {
|
||||
functionObject.events.forEach(event => {
|
||||
|
||||
@ -30,12 +30,6 @@ describe('#validate()', () => {
|
||||
};
|
||||
});
|
||||
|
||||
it('should throw an error if the compiled CloudFormation template is not available', () => {
|
||||
awsCompileApigEvents.serverless.service.provider.compiledCloudFormationTemplate = false;
|
||||
|
||||
expect(() => awsCompileApigEvents.validate()).to.throw(Error);
|
||||
});
|
||||
|
||||
it('should validate the http events "path" property', () => {
|
||||
awsCompileApigEvents.serverless.service.functions = {
|
||||
first: {
|
||||
|
||||
@ -13,11 +13,6 @@ class AwsCompileS3Events {
|
||||
}
|
||||
|
||||
compileS3Events() {
|
||||
if (!this.serverless.service.provider.compiledCloudFormationTemplate) {
|
||||
throw new this.serverless.classes
|
||||
.Error('This plugin needs access to the compiled CloudFormation template');
|
||||
}
|
||||
|
||||
this.serverless.service.getAllFunctions().forEach((functionName) => {
|
||||
const functionObj = this.serverless.service.getFunction(functionName);
|
||||
|
||||
|
||||
@ -21,11 +21,6 @@ describe('AwsCompileS3Events', () => {
|
||||
});
|
||||
|
||||
describe('#compileS3Events()', () => {
|
||||
it('should throw an error if the compiled CloudFormation template is not available', () => {
|
||||
awsCompileS3Events.serverless.service.provider.compiledCloudFormationTemplate = false;
|
||||
expect(() => awsCompileS3Events.compileS3Events()).to.throw(Error);
|
||||
});
|
||||
|
||||
it('should throw an error if s3 event type is not a string or an object', () => {
|
||||
awsCompileS3Events.serverless.service.functions = {
|
||||
first: {
|
||||
|
||||
@ -13,11 +13,6 @@ class AwsCompileScheduledEvents {
|
||||
}
|
||||
|
||||
compileScheduledEvents() {
|
||||
if (!this.serverless.service.provider.compiledCloudFormationTemplate) {
|
||||
throw new this.serverless.classes
|
||||
.Error('This plugin needs access to the compiled CloudFormation template');
|
||||
}
|
||||
|
||||
this.serverless.service.getAllFunctions().forEach((functionName) => {
|
||||
const functionObj = this.serverless.service.getFunction(functionName);
|
||||
|
||||
|
||||
@ -21,11 +21,6 @@ describe('AwsCompileScheduledEvents', () => {
|
||||
});
|
||||
|
||||
describe('#compileScheduledEvents()', () => {
|
||||
it('should throw an error if the compiled CloudFormation template is not available', () => {
|
||||
awsCompileScheduledEvents.serverless.service.provider.compiledCloudFormationTemplate = false;
|
||||
expect(() => awsCompileScheduledEvents.compileScheduledEvents()).to.throw(Error);
|
||||
});
|
||||
|
||||
it('should throw an error if schedule event type is not a string or an object', () => {
|
||||
awsCompileScheduledEvents.serverless.service.functions = {
|
||||
first: {
|
||||
|
||||
@ -13,11 +13,6 @@ class AwsCompileSNSEvents {
|
||||
}
|
||||
|
||||
compileSNSEvents() {
|
||||
if (!this.serverless.service.provider.compiledCloudFormationTemplate) {
|
||||
throw new this.serverless.classes
|
||||
.Error('This plugin needs access to the compiled CloudFormation template');
|
||||
}
|
||||
|
||||
this.serverless.service.getAllFunctions().forEach((functionName) => {
|
||||
const functionObj = this.serverless.service.getFunction(functionName);
|
||||
|
||||
|
||||
@ -20,11 +20,6 @@ describe('AwsCompileSNSEvents', () => {
|
||||
});
|
||||
|
||||
describe('#compileSNSEvents()', () => {
|
||||
it('should throw an error if the compiled CloudFormation template is not available', () => {
|
||||
awsCompileSNSEvents.serverless.service.provider.compiledCloudFormationTemplate = false;
|
||||
expect(() => awsCompileSNSEvents.compileSNSEvents()).to.throw(Error);
|
||||
});
|
||||
|
||||
it('should throw an error if SNS event type is not a string or an object', () => {
|
||||
awsCompileSNSEvents.serverless.service.functions = {
|
||||
first: {
|
||||
|
||||
@ -15,11 +15,6 @@ class AwsCompileFunctions {
|
||||
}
|
||||
|
||||
compileFunctions() {
|
||||
if (!this.serverless.service.provider.compiledCloudFormationTemplate) {
|
||||
throw new this.serverless.classes
|
||||
.Error('This plugin needs access to the compiled CloudFormation template');
|
||||
}
|
||||
|
||||
// merge in the iamRoleLambdaTemplate
|
||||
const iamRoleLambdaTemplate = this.serverless.utils.readFileSync(
|
||||
path.join(this.serverless.config.serverlessPath,
|
||||
|
||||
@ -30,11 +30,6 @@ describe('AwsCompileFunctions', () => {
|
||||
});
|
||||
|
||||
describe('#compileFunctions()', () => {
|
||||
it('should throw an error if the compiled CloudFormation template is not available', () => {
|
||||
awsCompileFunctions.serverless.service.provider.compiledCloudFormationTemplate = false;
|
||||
expect(() => awsCompileFunctions.compileFunctions()).to.throw(Error);
|
||||
});
|
||||
|
||||
it('should merge the IamRoleLambda template into the CloudFormation template', () => {
|
||||
const iamRoleLambdaTemplate = awsCompileFunctions.serverless.utils.readFileSync(
|
||||
path.join(
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user