Skip to content
This repository was archived by the owner on Jan 5, 2022. It is now read-only.

Commit 9b06b68

Browse files
committed
Fixed tests for CloudFront Lambda@Edge function
1 parent 0b046cd commit 9b06b68

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

modules/web/lambda/tests/suites/unit/index.spec.ts

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ describe("handler", () => {
3636

3737
/* Test: should set 'Content-Security-Policy' header */
3838
it("should set 'Content-Security-Policy' header", async () => {
39-
const { headers } = handler(event)
39+
const { headers } = await handler(event)
4040
expect(headers["Content-Security-Policy"]).toBeDefined()
4141
expect(headers["Content-Security-Policy"][0]).toEqual({
4242
key: "Content-Security-Policy",
@@ -46,7 +46,7 @@ describe("handler", () => {
4646

4747
/* Test: should set 'Strict-Transport-Security' header */
4848
it("should set 'Strict-Transport-Security' header", async () => {
49-
const { headers } = handler(event)
49+
const { headers } = await handler(event)
5050
expect(headers["Strict-Transport-Security"]).toBeDefined()
5151
expect(headers["Strict-Transport-Security"][0]).toEqual({
5252
key: "Strict-Transport-Security",
@@ -56,7 +56,7 @@ describe("handler", () => {
5656

5757
/* Test: should set 'Referrer-Policy' header */
5858
it("should set 'Referrer-Policy' header", async () => {
59-
const { headers } = handler(event)
59+
const { headers } = await handler(event)
6060
expect(headers["Referrer-Policy"]).toBeDefined()
6161
expect(headers["Referrer-Policy"][0]).toEqual({
6262
key: "Referrer-Policy",
@@ -66,7 +66,7 @@ describe("handler", () => {
6666

6767
/* Test: should set 'X-Content-Type-Options' header */
6868
it("should set 'X-Content-Type-Options' header", async () => {
69-
const { headers } = handler(event)
69+
const { headers } = await handler(event)
7070
expect(headers["X-Content-Type-Options"]).toBeDefined()
7171
expect(headers["X-Content-Type-Options"][0]).toEqual({
7272
key: "X-Content-Type-Options",
@@ -76,7 +76,7 @@ describe("handler", () => {
7676

7777
/* Test: should set 'X-Frame-Options' header */
7878
it("should set 'X-Frame-Options' header", async () => {
79-
const { headers } = handler(event)
79+
const { headers } = await handler(event)
8080
expect(headers["X-Frame-Options"]).toBeDefined()
8181
expect(headers["X-Frame-Options"][0]).toEqual({
8282
key: "X-Frame-Options",
@@ -86,7 +86,7 @@ describe("handler", () => {
8686

8787
/* Test: should set 'X-XSS-Protection' header */
8888
it("should set 'X-XSS-Protection' header", async () => {
89-
const { headers } = handler(event)
89+
const { headers } = await handler(event)
9090
expect(headers["X-XSS-Protection"]).toBeDefined()
9191
expect(headers["X-XSS-Protection"][0]).toEqual({
9292
key: "X-XSS-Protection",

0 commit comments

Comments
 (0)