diff --git a/.gitignore b/.gitignore index 5180a49..cafdd98 100644 --- a/.gitignore +++ b/.gitignore @@ -5,3 +5,4 @@ dist-ssr *.local cdk.out .vscode +coverage diff --git a/cdk/__snapshots__/cicd.awscommunitybuilders.org-stack.spec.ts.snap b/cdk/__snapshots__/cicd.awscommunitybuilders.org-stack.spec.ts.snap index ec92f36..e9924cf 100644 --- a/cdk/__snapshots__/cicd.awscommunitybuilders.org-stack.spec.ts.snap +++ b/cdk/__snapshots__/cicd.awscommunitybuilders.org-stack.spec.ts.snap @@ -242,30 +242,7 @@ exports[`Entire Stack > match a snapshot 1`] = ` }, "DeployWebsiteCustomResourceD116527B": { "DeletionPolicy": "Delete", - "Properties": { - "DestinationBucketName": { - "Ref": "WebsiteBucket75C24D94", - }, - "DistributionId": { - "Ref": "Distribution830FAC52", - }, - "DistributionPaths": [ - "/*", - ], - "Prune": true, - "ServiceToken": { - "Fn::GetAtt": [ - "CustomCDKBucketDeployment8693BB64968944B69AAFB0CC9EB8756C81C01536", - "Arn", - ], - }, - "SourceBucketNames": [ - "cdk-hnb659fds-assets-123456-eu-west-1", - ], - "SourceObjectKeys": [ - "f3a2740c33ec4f9b659a4d6d67c833575f0afb449a239afd3e8ce7d191d010fb.zip", - ], - }, + "Properties": {"ServiceToken":{"Fn::GetAtt":["CustomCDKBucketDeployment8693BB64968944B69AAFB0CC9EB8756C81C01536","Arn"]},"SourceBucketNames":["cdk-hnb659fds-assets-123456-eu-west-1"],"SourceObjectKeys":["a4937e6e9d08f655c6a605d1367d9c8f832eb68aa089641373e0b698e387f1c1.zip"],"DestinationBucketName":{"Ref":"WebsiteBucket75C24D94"},"Prune":true,"DistributionId":{"Ref":"Distribution830FAC52"},"DistributionPaths":["/*"],"S3Key":"[HASH REMOVED].zip"}, "Type": "Custom::CDKBucketDeployment", "UpdateReplacePolicy": "Delete", }, diff --git a/test/setup.ts b/test/setup.ts index 8c4fc78..ccdba21 100644 --- a/test/setup.ts +++ b/test/setup.ts @@ -2,5 +2,8 @@ import { expect } from 'vitest'; expect.addSnapshotSerializer({ serialize: (val) => JSON.stringify({ ...val, S3Key: '[HASH REMOVED].zip' }), - test: (val) => val && Object.prototype.hasOwnProperty.call(val, 'S3Key'), + test: (val) => + val && + (Object.prototype.hasOwnProperty.call(val, 'S3Key') || + Object.prototype.hasOwnProperty.call(val, 'SourceObjectKeys')), });