mirror of
https://github.com/serverless/serverless.git
synced 2026-01-25 15:07:39 +00:00
Enhance tests for invoke local
This commit is contained in:
parent
970302573b
commit
cf7a6fb4bf
@ -234,6 +234,7 @@ describe('AwsInvokeLocal', () => {
|
||||
expect(process.env.LAMBDA_TASK_ROOT).to.equal('/var/task');
|
||||
expect(process.env.LAMBDA_RUNTIME_DIR).to.equal('/var/runtime');
|
||||
expect(process.env.AWS_REGION).to.equal('us-east-1');
|
||||
expect(process.env.AWS_DEFAULT_REGION).to.equal('us-east-1');
|
||||
expect(process.env.AWS_LAMBDA_LOG_GROUP_NAME).to.equal('/aws/lambda/serviceName-dev-hello');
|
||||
expect(process.env.AWS_LAMBDA_LOG_STREAM_NAME)
|
||||
.to.equal('2016/12/02/[$LATEST]f77ff5e4026c45bda9a9ebcec6bc9cad');
|
||||
@ -244,8 +245,20 @@ describe('AwsInvokeLocal', () => {
|
||||
})
|
||||
);
|
||||
|
||||
|
||||
it('should fallback to service provider configuration when options are not available', () => {
|
||||
awsInvokeLocal.options.region = null;
|
||||
awsInvokeLocal.serverless.service.provider.region = 'us-west-1';
|
||||
|
||||
return awsInvokeLocal.loadEnvVars().then(() => {
|
||||
expect(process.env.AWS_REGION).to.equal('us-west-1');
|
||||
expect(process.env.AWS_DEFAULT_REGION).to.equal('us-west-1');
|
||||
});
|
||||
});
|
||||
|
||||
it('it should overwrite provider env vars', () => {
|
||||
awsInvokeLocal.options.functionObj.environment.providerVar = 'providerValueOverwritten';
|
||||
|
||||
return awsInvokeLocal.loadEnvVars().then(() => {
|
||||
expect(process.env.providerVar).to.be.equal('providerValueOverwritten');
|
||||
});
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user