From b425d2a56836a22bc5a0413ff93b159a305904dc Mon Sep 17 00:00:00 2001 From: Gowri Date: Fri, 29 Sep 2023 14:00:47 +0930 Subject: [PATCH] DO-1530: remove unused test and code clean up --- package.json | 2 +- .../cloudfront-security-headers/lib/index.ts | 4 +++- .../cdk-cloudfront-security-headers.test.ts | 17 ----------------- 3 files changed, 4 insertions(+), 19 deletions(-) delete mode 100644 packages/cloudfront-security-headers/test/cdk-cloudfront-security-headers.test.ts diff --git a/package.json b/package.json index c0870056..6bf4089c 100644 --- a/package.json +++ b/package.json @@ -19,7 +19,7 @@ "homepage": "https://github.com/aligent/aws-cdk-constructs#readme", "scripts": { "build": "tsc", - "prepublish": "tsc", + "prepublish": "npm run build", "lint": "eslint --ignore-path .eslintignore --ext .ts .", "lint:check": "npm run lint", "lint:fix": "npm run lint --fix", diff --git a/packages/cloudfront-security-headers/lib/index.ts b/packages/cloudfront-security-headers/lib/index.ts index 3df24046..91e32fdf 100644 --- a/packages/cloudfront-security-headers/lib/index.ts +++ b/packages/cloudfront-security-headers/lib/index.ts @@ -19,7 +19,9 @@ export class SecurityHeaderFunction extends Construct { ) { super(scope, id); - const defineOptions: any = {}; + const defineOptions: { + __CONTENT_SECURITY_POLICY__?: string + } = {}; if (props?.contentSecurityPolicy) { defineOptions.__CONTENT_SECURITY_POLICY__ = JSON.stringify( diff --git a/packages/cloudfront-security-headers/test/cdk-cloudfront-security-headers.test.ts b/packages/cloudfront-security-headers/test/cdk-cloudfront-security-headers.test.ts deleted file mode 100644 index f862c662..00000000 --- a/packages/cloudfront-security-headers/test/cdk-cloudfront-security-headers.test.ts +++ /dev/null @@ -1,17 +0,0 @@ -// import { expect as expectCDK, countResources } from "@aws-cdk/assert"; -// import * as cdk from "aws-cdk-lib"; -// import { SecurityHeaderFunction } from "../lib/index"; - -/* - * Example test - */ -// test("Lambda Function Created", () => { -// const app = new cdk.App(); -// const stack = new cdk.Stack(app, "TestStack", { -// env: { region: "us-east-1" }, -// }); -// // WHEN -// new SecurityHeaderFunction(stack, "MyTestConstruct"); -// // THEN -// expectCDK(stack).to(countResources("AWS::Lambda::Function", 1)); -// });