From 1880369541ba27a8d74fb4eee1f370d8a2270c71 Mon Sep 17 00:00:00 2001 From: Kenji Kono Date: Mon, 6 Mar 2023 19:58:49 +0900 Subject: [PATCH] use single quotes in error message --- .../lib/aws-custom-resource/aws-custom-resource.ts | 4 ++-- .../test/aws-custom-resource/aws-custom-resource.test.ts | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/packages/@aws-cdk/custom-resources/lib/aws-custom-resource/aws-custom-resource.ts b/packages/@aws-cdk/custom-resources/lib/aws-custom-resource/aws-custom-resource.ts index 95ed58be0ce12..4f323576ca461 100644 --- a/packages/@aws-cdk/custom-resources/lib/aws-custom-resource/aws-custom-resource.ts +++ b/packages/@aws-cdk/custom-resources/lib/aws-custom-resource/aws-custom-resource.ts @@ -386,11 +386,11 @@ export class AwsCustomResource extends Construct implements iam.IGrantable { } if (props.onCreate && !props.onCreate.physicalResourceId) { - throw new Error('`physicalResourceId` must be specified for onCreate call.'); + throw new Error("'physicalResourceId' must be specified for 'onCreate' call."); } if (!props.onCreate && props.onUpdate && !props.onUpdate.physicalResourceId) { - throw new Error('`physicalResourceId` must be specified for onUpdate call when onCreate is omitted.'); + throw new Error("'physicalResourceId' must be specified for 'onUpdate' call when 'onCreate' is omitted."); } for (const call of [props.onCreate, props.onUpdate, props.onDelete]) { diff --git a/packages/@aws-cdk/custom-resources/test/aws-custom-resource/aws-custom-resource.test.ts b/packages/@aws-cdk/custom-resources/test/aws-custom-resource/aws-custom-resource.test.ts index fb96c470ffe5b..4abe91ce97038 100644 --- a/packages/@aws-cdk/custom-resources/test/aws-custom-resource/aws-custom-resource.test.ts +++ b/packages/@aws-cdk/custom-resources/test/aws-custom-resource/aws-custom-resource.test.ts @@ -319,7 +319,7 @@ describe('physicalResourceId patterns', () => { }, policy: AwsCustomResourcePolicy.fromSdkCalls({ resources: AwsCustomResourcePolicy.ANY_RESOURCE }), }); - }).toThrow(/`physicalResourceId` must be specified for onCreate call./); + }).toThrow(/'physicalResourceId' must be specified for 'onCreate' call./); }); // physicalResourceId pattern #4 @@ -349,7 +349,7 @@ describe('physicalResourceId patterns', () => { }, policy: AwsCustomResourcePolicy.fromSdkCalls({ resources: AwsCustomResourcePolicy.ANY_RESOURCE }), }); - }).toThrow(/`physicalResourceId` must be specified for onCreate call./); + }).toThrow(/'physicalResourceId' must be specified for 'onCreate' call./); }); // physicalResourceId pattern #5 @@ -407,7 +407,7 @@ describe('physicalResourceId patterns', () => { }, policy: AwsCustomResourcePolicy.fromSdkCalls({ resources: AwsCustomResourcePolicy.ANY_RESOURCE }), }); - }).toThrow(/`physicalResourceId` must be specified for onCreate call./); + }).toThrow(/'physicalResourceId' must be specified for 'onCreate' call./); }); // physicalResourceId pattern #7