silverbullet/lib/plugos/syscalls/fs.deno.test.ts

18 lines
540 B
TypeScript
Raw Normal View History

2024-02-29 22:23:05 +08:00
import { FileMeta } from "../../../plug-api/types.ts";
import { assert } from "$lib/test_deps.ts";
import { path } from "../deps.ts";
import fileSystemSyscalls from "./fs.deno.ts";
Deno.test("Test FS operations", async () => {
2023-01-23 01:53:14 +08:00
const thisFolder = path.resolve(
path.dirname(new URL(import.meta.url).pathname),
2023-01-23 01:53:14 +08:00
);
const syscalls = fileSystemSyscalls(thisFolder);
const allFiles: FileMeta[] = await syscalls["fs.listFiles"](
{},
thisFolder,
true,
);
assert(allFiles.find((f) => f.name === "fs.deno.test.ts"));
});