Files
bun.sh/test/regression/issue/09340.test.ts
2024-09-03 21:32:52 -07:00

17 lines
559 B
TypeScript

import { $ } from "bun";
import { expect, test } from "bun:test";
import { tempDirWithFiles } from "harness";
import { readdirSync } from "node:fs";
test("bun shell should move multiple files", async () => {
const files = { file1: "", file2: "", file3: "" };
const filenames = Object.keys(files);
const source = tempDirWithFiles("source", files);
const target = tempDirWithFiles("target", {});
await $`mv ${filenames} ${target}`.cwd(source);
expect(readdirSync(source)).toBeEmpty();
expect(readdirSync(target).sort()).toEqual(filenames);
});