MCPcopy Create free account
hub / github.com/obgnail/typora_plugin / createTestDir

Function createTestDir

develop/test/utils.test.js:1276–1287  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

1274describe("File System Utilities", () => {
1275 describe("utils.walkDir", () => {
1276 const createTestDir = async () => {
1277 const tmpDir = await fs.mkdtemp(path.join(os.tmpdir(), "walkdir-test-"))
1278 await fs.mkdir(path.join(tmpDir, "subdir1"), { recursive: true })
1279 await fs.mkdir(path.join(tmpDir, "subdir2"), { recursive: true })
1280 await fs.mkdir(path.join(tmpDir, "subdir1", "nested"), { recursive: true })
1281 await fs.writeFile(path.join(tmpDir, "file1.txt"), "content1")
1282 await fs.writeFile(path.join(tmpDir, "file2.md"), "# content2")
1283 await fs.writeFile(path.join(tmpDir, "subdir1", "file3.txt"), "content3")
1284 await fs.writeFile(path.join(tmpDir, "subdir2", "file4.js"), "content4")
1285 await fs.writeFile(path.join(tmpDir, "subdir1", "nested", "file5.txt"), "content5")
1286 return tmpDir
1287 }
1288 const cleanupTestDir = async (tmpDir) => fs.rm(tmpDir, { recursive: true, force: true })
1289
1290 it("traverses directory structure with BFS strategy", async () => {

Callers 1

utils.test.jsFile · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected