@@ -30,17 +30,19 @@ function killFileServer(): void {
3030 fileServer . stdout ! . close ( ) ;
3131}
3232
33- /* TODO(ry) re-enable tests
3433test ( async function serveFile ( ) : Promise < void > {
3534 await startFileServer ( ) ;
3635 try {
37- const res = await fetch("http://localhost:4500/azure-pipelines.yml ");
36+ const res = await fetch ( "http://localhost:4500/tsconfig.json " ) ;
3837 assert ( res . headers . has ( "access-control-allow-origin" ) ) ;
3938 assert ( res . headers . has ( "access-control-allow-headers" ) ) ;
40- assertEquals(res.headers.get("content-type"), "text/yaml; charset=utf-8");
39+ assertEquals (
40+ res . headers . get ( "content-type" ) ,
41+ "application/json; charset=utf-8"
42+ ) ;
4143 const downloadedFile = await res . text ( ) ;
4244 const localFile = new TextDecoder ( ) . decode (
43- await Deno.readFile("./azure-pipelines.yml ")
45+ await Deno . readFile ( "./tsconfig.json " )
4446 ) ;
4547 assertEquals ( downloadedFile , localFile ) ;
4648 } finally {
@@ -55,7 +57,7 @@ test(async function serveDirectory(): Promise<void> {
5557 assert ( res . headers . has ( "access-control-allow-origin" ) ) ;
5658 assert ( res . headers . has ( "access-control-allow-headers" ) ) ;
5759 const page = await res . text ( ) ;
58- assert(page.includes("azure-pipelines.yml "));
60+ assert ( page . includes ( "tsconfig.json " ) ) ;
5961
6062 // `Deno.FileInfo` is not completely compatible with Windows yet
6163 // TODO: `mode` should work correctly in the future.
@@ -65,15 +67,12 @@ test(async function serveDirectory(): Promise<void> {
6567 Deno . build . os === "win" &&
6668 assert ( / < t d c l a s s = " m o d e " > \( u n k n o w n m o d e \) < \/ t d > / . test ( page ) ) ;
6769 assert (
68- page.includes(
69- `<td><a href="/azure-pipelines.yml">azure-pipelines.yml</a></td>`
70- )
70+ page . includes ( `<td><a href="/tsconfig.json">tsconfig.json</a></td>` )
7171 ) ;
7272 } finally {
7373 killFileServer ( ) ;
7474 }
7575} ) ;
76- */
7776
7877test ( async function serveFallback ( ) : Promise < void > {
7978 await startFileServer ( ) ;
0 commit comments