1
0
silverbullet/plugos/syscalls/fs.deno.test.ts
2023-01-01 11:28:25 -08:00

19 lines
610 B
TypeScript

import { assert } from "../../test_deps.ts";
import { FileMeta } from "../../common/types.ts";
import { path } from "../deps.ts";
import fileSystemSyscalls from "./fs.deno.ts";
import { urlToPathname } from "../util.ts";
const fakeCtx = {} as any;
Deno.test("Test FS operations", async () => {
const thisFolder = path.resolve(path.dirname(urlToPathname(new URL(import.meta.url))));
const syscalls = fileSystemSyscalls(thisFolder);
const allFiles: FileMeta[] = await syscalls["fs.listFiles"](
fakeCtx,
thisFolder,
true,
);
assert(allFiles.find((f) => f.name === "fs.deno.test.ts"));
});