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

18 lines
540 B
TypeScript
Raw Normal View History

2024-07-30 23:33:33 +08:00
import type { FileMeta } from "../../../plug-api/types.ts";
2024-07-30 23:24:17 +08:00
import { assert } from "@std/assert";
import fileSystemSyscalls from "./fs.deno.ts";
2024-10-11 21:52:37 +08:00
import { dirname, resolve } from "@std/path";
Deno.test("Test FS operations", async () => {
2024-10-11 21:52:37 +08:00
const thisFolder = resolve(
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"));
});