deno.land / x / alosaur@v1.1.1 / e2e / spa.test.ts

نووسراو ببینە
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
import { assertEquals } from "../src/deps_test.ts";import { killServer, startServer } from "./test.utils.ts";const { test } = Deno;
/** * Test cases */test({ name: "[http] spa server, requests to info controller", async fn(t): Promise<void> { const process = await startServer("./examples/spa/app.ts"); const baseUrl = "http://localhost:8000";
try { // await t.step("/", async () => { const response = await fetch(baseUrl); const text = await response.text(); assertEquals(response.status, 404); // });
await t.step("/www", async () => { const response = await fetch(baseUrl + "/www"); const text = await response.text(); assertEquals(response.status, 200); });
await t.step("/www/spa-route", async () => { const response = await fetch(baseUrl + "/www/spa-route"); const text = await response.text(); assertEquals(response.status, 200); }); } finally { killServer(process); } },});
alosaur

Version Info

Tagged at
2 months ago