-
Notifications
You must be signed in to change notification settings - Fork 0
/
duration.enum_test.ts
47 lines (38 loc) · 1.14 KB
/
duration.enum_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
43
44
45
46
47
import { expect, Rhum } from "./deps_test.ts";
import { Duration } from "./duration.enum.ts";
Rhum.testPlan("duration_test.ts", () => {
Rhum.testSuite("Duration", () => {
Rhum.testCase("Contains keys WEEK, DAY, HOUR, MINUTE and SECOND", () => {
const keys: string[] = [
"WEEK",
"DAY",
"HOUR",
"MINUTE",
"SECOND",
];
const includes = keys
.map((key) =>
Object.keys(Duration)
.includes(key)
)
.every((val) => val);
expect(includes).toEqual(true);
});
Rhum.testCase("Duration.WEEK equals 604800000s", () => {
expect(Duration.WEEK).toEqual(604800000);
});
Rhum.testCase("Duration.DAY equals 86400000s", () => {
expect(Duration.DAY).toEqual(86400000);
});
Rhum.testCase("Duration.HOUR equals 3600000s", () => {
expect(Duration.HOUR).toEqual(3600000);
});
Rhum.testCase("Duration.MINUTE equals 60000s", () => {
expect(Duration.MINUTE).toEqual(60000);
});
Rhum.testCase("Duration.SECOND equals 1000s", () => {
expect(Duration.SECOND).toEqual(1000);
});
});
});
Rhum.run();