-
Notifications
You must be signed in to change notification settings - Fork 0
/
bootstrap_test.ts
43 lines (36 loc) · 1.09 KB
/
bootstrap_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
import { assertArrayIncludes } from "https://deno.land/std@0.146.0/testing/asserts.ts";
import { info } from "https://deno.land/std@0.146.0/log/mod.ts";
import { bootstrap } from "./bootstrap.ts";
const testErrorHandler = (message: string, error?: Error) => {
info(message);
info(error);
};
Deno.test("bootstrap", async (t) => {
const testingPath = await Deno.makeTempDir();
await t.step("creates the required files", async () => {
await bootstrap(testingPath, testErrorHandler);
const files = Array.from(Deno.readDirSync(testingPath));
assertArrayIncludes(files, [
{
name: "FOOTER.template.md",
isFile: true,
isSymlink: false,
isDirectory: false,
},
{
name: "HEADER.template.md",
isFile: true,
isSymlink: false,
isDirectory: false,
},
{
name: "README.template.md",
isFile: true,
isSymlink: false,
isDirectory: false,
},
]);
});
await Deno.remove(testingPath, { recursive: true });
await Deno.remove(`${testingPath}.old`, { recursive: true });
});