Skip to content

Commit

Permalink
Adding a test to cover invalid intrinsics.
Browse files Browse the repository at this point in the history
  • Loading branch information
mikewrighton committed Sep 9, 2024
1 parent de58d24 commit ae3b9b1
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,10 @@
"Properties": {
"BucketName": "cdk-integ-cfn-include-bucket2",
"Tags": [
{
"Key": "Key1",
"Value": "Value1"
},
{
"Fn::If": [
"ShouldIncludeTag",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1129,6 +1129,12 @@ describe('CDK Include', () => {
loadTestFileToJsObject('tags-with-intrinsics.json'),
);
});

test('throws an exception if Tags contains invalid intrinsics', () => {
expect(() => {
includeTestTemplate(stack, 'tags-with-invalid-intrinsics.json');
}).toThrow(/expression does not exist in the template/);
});
});

interface IncludeTestTemplateProps {
Expand Down

0 comments on commit ae3b9b1

Please sign in to comment.