Skip to content

Commit

Permalink
fix test
Browse files Browse the repository at this point in the history
  • Loading branch information
elthrasher committed Apr 10, 2023
1 parent 6a4096a commit 1bf9a16
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 25 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,4 @@ dist-ssr
*.local
cdk.out
.vscode
coverage
Original file line number Diff line number Diff line change
Expand Up @@ -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",
},
Expand Down
5 changes: 4 additions & 1 deletion test/setup.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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')),
});

0 comments on commit 1bf9a16

Please sign in to comment.