mirror of
https://github.com/serverless/serverless.git
synced 2026-01-18 14:58:43 +00:00
Add provider-level inheritance test
This commit is contained in:
parent
7ce86483ab
commit
df145c45c8
@ -135,6 +135,10 @@ describe('AwsDeployFunction', () => {
|
||||
|
||||
afterEach(() => {
|
||||
awsDeployFunction.provider.request.restore();
|
||||
awsDeployFunction.serverless.service.provider.timeout = undefined;
|
||||
awsDeployFunction.serverless.service.provider.memorySize = undefined;
|
||||
awsDeployFunction.serverless.service.provider.role = undefined;
|
||||
awsDeployFunction.serverless.service.provider.vpc = undefined;
|
||||
});
|
||||
|
||||
it('should update function\'s configuration', () => {
|
||||
@ -211,6 +215,44 @@ describe('AwsDeployFunction', () => {
|
||||
)).to.be.equal(true);
|
||||
});
|
||||
});
|
||||
|
||||
it('should inherit provider-level config', () => {
|
||||
options.functionObj = {
|
||||
name: 'first',
|
||||
description: 'change',
|
||||
};
|
||||
|
||||
awsDeployFunction.serverless.service.provider.timeout = 12;
|
||||
awsDeployFunction.serverless.service.provider.memorySize = 512;
|
||||
awsDeployFunction.serverless.service.provider.role = 'role';
|
||||
awsDeployFunction.serverless.service.provider.vpc = {
|
||||
securityGroupIds: [123, 12],
|
||||
subnetIds: [1234, 12345],
|
||||
};
|
||||
|
||||
awsDeployFunction.options = options;
|
||||
|
||||
return awsDeployFunction.updateFunctionConfiguration().then(() => {
|
||||
expect(updateFunctionConfigurationStub.calledOnce).to.be.equal(true);
|
||||
expect(updateFunctionConfigurationStub.calledWithExactly(
|
||||
'Lambda',
|
||||
'updateFunctionConfiguration',
|
||||
{
|
||||
FunctionName: 'first',
|
||||
Description: 'change',
|
||||
VpcConfig: {
|
||||
SubnetIds: [1234, 12345],
|
||||
SecurityGroupIds: [123, 12],
|
||||
},
|
||||
Timeout: 12,
|
||||
MemorySize: 512,
|
||||
Role: 'role',
|
||||
},
|
||||
awsDeployFunction.options.stage,
|
||||
awsDeployFunction.options.region
|
||||
)).to.be.equal(true);
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
describe('#deployFunction()', () => {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user