helps manage and harmonise READMEs in many repositories with template files available on deno.land/x/readme_manager
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
readme-manager/bootstrap_test.ts

43 lines
1.1 KiB

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 });
});