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

microservice.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
import { assertEquals } from "../src/deps_test.ts";import { killServer, startServer } from "./test.utils.ts";import { delay } from "../examples/_utils/test.utils.ts";const { test } = Deno;
/** * Test cases */test({ name: "microservice app server should response", async fn(): Promise<void> { const process1 = await startServer( "./examples/microservice/mservice/app.ts", ); await delay(100);
const process2 = await startServer("./examples/microservice/app/app.ts");
await delay(100);
const baseUrl = "http://localhost:8000";
try { const r = await fetch(baseUrl + "/");
const text_r = await r.text();
assertEquals(text_r, "Hello world, 10"); } finally { killServer(process1); killServer(process2); } },});
alosaur

Version Info

Tagged at
2 months ago