Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add tests for DeadLetterConfig #215

Merged
merged 2 commits into from
Apr 3, 2017
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 14 additions & 1 deletion test/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,20 @@ describe('node-lambda', function () {
assert.equal(Object.keys(params.VpcConfig.SecurityGroupIds).length, 0);
});

it('appends DeadLetterConfig to params when DLQ params set', function() {
['', 'arn:aws:sqs:test'].forEach(function(v) {
program.deadLetterConfigTargetArn = v;
const params = lambda._params(program);
assert.equal(params.DeadLetterConfig.TargetArn, v, v);
});
});

it('does not append DeadLetterConfig when params are not set', function() {
delete program.deadLetterConfigTargetArn;
var params = lambda._params(program);
assert.isNull(params.DeadLetterConfig.TargetArn);
});

describe('configFile', function () {
beforeEach(function () {
// Prep...
Expand Down Expand Up @@ -493,6 +507,5 @@ describe('node-lambda', function () {
);
});
});

});
});