-
Notifications
You must be signed in to change notification settings - Fork 0
/
config_test.ts
42 lines (38 loc) · 1.02 KB
/
config_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
38
39
40
41
42
import { assertStrictEquals, ConfigureHandler } from "./deps.ts";
Deno.test("testConfigureHandler", () => {
const ch = new ConfigureHandler();
let expectedApiUrl: string = "http://localhost:8112";
let expectedHtdocs: string = "htdocs";
let expectedDebug: boolean = false;
assertStrictEquals(
ch.apiUrl,
expectedApiUrl,
`expected ${expectedApiUrl}, got ${ch.apiUrl}`,
);
assertStrictEquals(
ch.htdocs,
expectedHtdocs,
`expected ${expectedHtdocs}, got ${ch.htdocs}`,
);
assertStrictEquals(
ch.debug,
expectedDebug,
`expected ${expectedDebug}, got ${ch.debug}`,
);
let got: { debug: boolean; htdocs: string; apiUrl: string } = ch.cfg();
assertStrictEquals(
got.apiUrl,
expectedApiUrl,
`expected ${expectedApiUrl}, got ${got.apiUrl}`,
);
assertStrictEquals(
got.htdocs,
expectedHtdocs,
`expected ${expectedHtdocs}, got ${got.htdocs}`,
);
assertStrictEquals(
got.debug,
expectedDebug,
`expected ${expectedDebug}, got ${got.debug}`,
);
});