Philipp Muens 1d631e0133 Add validateInput method
Add a validation step so that validation checks don't need to be rewritten in
each compile method / step.
2016-06-15 12:25:44 +02:00

24 lines
647 B
JavaScript

'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);
});
});