@@ -18,7 +18,7 @@ Deno.test("create server with cors does not throw", () => {
1818
1919Deno . test ( "simple text response" , async ( ) => {
2020 const handler = createCorsHandler ( ) ;
21- const { url, close, fetch } = mountServer ( handler ) ;
21+ const { url, close, fetch } = await mountServer ( handler ) ;
2222 const res = await fetch ( url ) ;
2323 expectHeaders (
2424 res ,
@@ -38,7 +38,7 @@ Deno.test("6.1.1 Does not set headers if Origin is missing", async () => {
3838 const app = createCorsHandler ( {
3939 allowOrigin : [ "http://api.myapp.com" , "http://www.myapp.com" ] ,
4040 } ) ;
41- const { url, close, fetch } = mountServer ( app ) ;
41+ const { url, close, fetch } = await mountServer ( app ) ;
4242 const res = await fetch ( url ) ;
4343 expectHeaders (
4444 res ,
@@ -58,7 +58,7 @@ Deno.test("6.1.2 Does not set headers if Origin does not match", async () => {
5858 const app = createCorsHandler ( {
5959 allowOrigin : [ "http://api.myapp.com" , "http://www.myapp.com" ] ,
6060 } ) ;
61- const { url, close, fetch } = mountServer ( app ) ;
61+ const { url, close, fetch } = await mountServer ( app ) ;
6262 const res = await fetch ( url , {
6363 headers : {
6464 Origin : "http://random-website.com" ,
@@ -82,7 +82,7 @@ Deno.test("6.1.3 Sets Allow-Origin headers if the Origin matches", async () => {
8282 const app = createCorsHandler ( {
8383 allowOrigin : [ "http://api.myapp.com" , "http://www.myapp.com" ] ,
8484 } ) ;
85- const { url, close, fetch } = mountServer ( app ) ;
85+ const { url, close, fetch } = await mountServer ( app ) ;
8686 const res = await fetch ( url , {
8787 headers : {
8888 Origin : "http://api.myapp.com" ,
@@ -107,7 +107,7 @@ Deno.test("Sets Allow-Origin headers if allowOrigin is true (wildcard)", async (
107107 const app = createCorsHandler ( {
108108 allowOrigin : true ,
109109 } ) ;
110- const { url, close, fetch } = mountServer ( app ) ;
110+ const { url, close, fetch } = await mountServer ( app ) ;
111111 const res = await fetch ( url , {
112112 headers : {
113113 Origin : "http://api.myapp.com" ,
@@ -133,7 +133,7 @@ Deno.test("6.1.3 Sets Access-Control-Allow-Credentials header if configured", as
133133 allowOrigin : [ "http://api.myapp.com" ] ,
134134 allowCredentials : true ,
135135 } ) ;
136- const { url, close, fetch } = mountServer ( app ) ;
136+ const { url, close, fetch } = await mountServer ( app ) ;
137137 const res = await fetch ( url , {
138138 headers : {
139139 Origin : "http://api.myapp.com" ,
@@ -159,7 +159,7 @@ Deno.test("6.1.4 Does not set exposed headers if empty", async () => {
159159 const app = createCorsHandler ( {
160160 allowOrigin : [ "http://api.myapp.com" , "http://www.myapp.com" ] ,
161161 } ) ;
162- const { url, close, fetch } = mountServer ( app ) ;
162+ const { url, close, fetch } = await mountServer ( app ) ;
163163 const res = await fetch ( url , {
164164 headers : {
165165 Origin : "http://api.myapp.com" ,
@@ -185,7 +185,7 @@ Deno.test("6.1.4 Sets exposed headers if configured", async () => {
185185 allowOrigin : [ "http://api.myapp.com" , "http://www.myapp.com" ] ,
186186 exposeHeaders : [ "HeaderA" , "HeaderB" ] ,
187187 } ) ;
188- const { url, close, fetch } = mountServer ( app ) ;
188+ const { url, close, fetch } = await mountServer ( app ) ;
189189 const res = await fetch ( url , {
190190 headers : {
191191 Origin : "http://api.myapp.com" ,
0 commit comments