From 4d3fa667ca4c5b1cd221b65704e2b05e29bd3a93 Mon Sep 17 00:00:00 2001 From: Philipp Muens Date: Wed, 15 Jun 2016 18:32:30 +0200 Subject: [PATCH] Remove validateInput as it's functionality is replaced --- .../awsCompileApigEvents/lib/validateInput.js | 16 ------------- lib/plugins/awsCompileApigEvents/tests/all.js | 1 - .../tests/validateInput.js | 23 ------------------- 3 files changed, 40 deletions(-) delete mode 100644 lib/plugins/awsCompileApigEvents/lib/validateInput.js delete mode 100644 lib/plugins/awsCompileApigEvents/tests/validateInput.js diff --git a/lib/plugins/awsCompileApigEvents/lib/validateInput.js b/lib/plugins/awsCompileApigEvents/lib/validateInput.js deleted file mode 100644 index 4b8776ad0..000000000 --- a/lib/plugins/awsCompileApigEvents/lib/validateInput.js +++ /dev/null @@ -1,16 +0,0 @@ -'use strict'; - -const BbPromise = require('bluebird'); - -module.exports = { - validateInput() { - if (!this.serverless.service.resources.aws.Resources) { - throw new this.serverless.Error( - 'This plugin needs access to Resources section of the AWS CloudFormation template'); - } - - return BbPromise.resolve(); - }, -}; - - diff --git a/lib/plugins/awsCompileApigEvents/tests/all.js b/lib/plugins/awsCompileApigEvents/tests/all.js index e369a3ef9..a9db12903 100644 --- a/lib/plugins/awsCompileApigEvents/tests/all.js +++ b/lib/plugins/awsCompileApigEvents/tests/all.js @@ -1,7 +1,6 @@ 'use strict'; require('./awsCompileApigEvents'); -require('./validateInput'); require('./compilePermissions'); require('./compileRestApi'); require('./compileDeployment'); diff --git a/lib/plugins/awsCompileApigEvents/tests/validateInput.js b/lib/plugins/awsCompileApigEvents/tests/validateInput.js deleted file mode 100644 index c80d62f74..000000000 --- a/lib/plugins/awsCompileApigEvents/tests/validateInput.js +++ /dev/null @@ -1,23 +0,0 @@ -'use strict'; - -const expect = require('chai').expect; -const AwsCompileApigEvents = require('../awsCompileApigEvents'); -const Serverless = require('../../../Serverless'); - -describe('#validate()', () => { - let serverless; - let awsCompileApigEvents; - - beforeEach(() => { - serverless = new Serverless(); - serverless.init(); - serverless.service.resources = { aws: {} }; - awsCompileApigEvents = new AwsCompileApigEvents(serverless); - }); - - it('should throw an error if the AWS Resources section is not ' + - 'available in the service object', () => { - expect(() => awsCompileApigEvents.validateInput()).to.throw(Error); - }); -}); -