mirror of
https://github.com/serverless/serverless.git
synced 2026-01-18 14:58:43 +00:00
Add a validation step so that validation checks don't need to be rewritten in each compile method / step.
24 lines
647 B
JavaScript
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);
|
|
});
|
|
});
|
|
|