-
-
Notifications
You must be signed in to change notification settings - Fork 1
/
routePlanForContentWithCss.test.mjs
57 lines (52 loc) · 1.39 KB
/
routePlanForContentWithCss.test.mjs
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
48
49
50
51
52
53
54
55
56
57
// @ts-check
import { assertThrows } from "std/testing/asserts.ts";
import HeadManager from "./HeadManager.mjs";
import routePlanForContentWithCss from "./routePlanForContentWithCss.mjs";
Deno.test("`routePlanForContentWithCss` with argument 1 `routeContentWithCss` not an object or promise.", () => {
assertThrows(
() => {
routePlanForContentWithCss(
// @ts-expect-error Testing invalid.
true,
new HeadManager(),
true,
);
},
TypeError,
"Argument 1 `routeContentWithCss` must be an object or promise.",
);
});
Deno.test("`routePlanForContentWithCss` with argument 2 `headManager` not a `HeadManager` instance.", () => {
assertThrows(
() => {
routePlanForContentWithCss(
{
content: null,
css: new Set(["/"]),
},
// @ts-expect-error Testing invalid.
true,
true,
);
},
TypeError,
"Argument 2 `headManager` must be a `HeadManager` instance.",
);
});
Deno.test("`routePlanForContentWithCss` with argument 3 `isInitialRoute` not a boolean.", () => {
assertThrows(
() => {
routePlanForContentWithCss(
{
content: null,
css: new Set(["/"]),
},
new HeadManager(),
// @ts-expect-error Testing invalid.
null,
);
},
TypeError,
"Argument 3 `isInitialRoute` must be a boolean.",
);
});