-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcli_test.ts
More file actions
42 lines (34 loc) · 1013 Bytes
/
cli_test.ts
File metadata and controls
42 lines (34 loc) · 1013 Bytes
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 {
assert,
assertEquals,
} from "https://deno.land/std@0.188.0/testing/asserts.ts";
import $ from "https://deno.land/x/dax@0.31.1/mod.ts";
Deno.test("Able to install", async () => {
await $`deno task install`.quiet();
});
Deno.test("Able to print help message", async () => {
assert((await $`bundle -h`.text()).includes("Show this help"));
});
Deno.test("Able to bundle basic example", async () => {
await $`bundle -e ./test/basic/mod.ts`.quiet();
assertEquals(
await $`deno run ./bundle.ts`.text(),
"hi\nThis is a side module!",
);
});
Deno.test("Able to bundle tla example", async () => {
await $`bundle -e ./test/tla/mod.ts`.quiet();
assert(
(await $`deno run --allow-net ./bundle.ts`.text()).includes(
"Example Domain",
),
);
});
Deno.test("Able to bundle remote example", async () => {
await $`bundle -e ./test/remote/mod.ts`.quiet();
assert(
(await $`deno run --allow-net ./bundle.ts`.text()).includes(
"Example Domain",
),
);
});