|
1 | 1 | import { before, after, fs } from "./setup";
|
2 | 2 | import { isValidUUID } from "@cocalc/util/misc";
|
3 |
| -// import { readFile, writeFile } from "fs/promises"; |
4 |
| -// import { join } from "path"; |
| 3 | +import { readFile, writeFile } from "fs/promises"; |
| 4 | +import { join } from "path"; |
5 | 5 |
|
6 | 6 | beforeAll(before);
|
7 | 7 |
|
@@ -60,15 +60,21 @@ describe("operations with subvolumes", () => {
|
60 | 60 | await fs.rsync({ src: "sagemath", target: "cython" });
|
61 | 61 | });
|
62 | 62 |
|
63 |
| - // it("rsync with an actual file", async () => { |
64 |
| - // const sagemath = await fs.subvolume("sagemath"); |
65 |
| - // const cython = await fs.subvolume("cython"); |
66 |
| - // await writeFile(join(sagemath.path, "README.md"), "hi"); |
67 |
| - // await fs.rsync({ src: "sagemath", target: "cython" }); |
68 |
| - // expect((await readFile(join(sagemath.path, "README.md")), "utf8")).toEqual( |
69 |
| - // "hi", |
70 |
| - // ); |
71 |
| - // }); |
| 63 | + it("rsync an actual file", async () => { |
| 64 | + const sagemath = await fs.subvolume("sagemath"); |
| 65 | + const cython = await fs.subvolume("cython"); |
| 66 | + await writeFile(join(sagemath.path, "README.md"), "hi"); |
| 67 | + await fs.rsync({ src: "sagemath", target: "cython" }); |
| 68 | + const copy = await readFile(join(cython.path, "README.md"), "utf8"); |
| 69 | + expect(copy).toEqual("hi"); |
| 70 | + }); |
| 71 | + |
| 72 | + it("clone a subvolume with contents", async () => { |
| 73 | + await fs.cloneSubvolume("cython", "pyrex"); |
| 74 | + const pyrex = await fs.subvolume("pyrex"); |
| 75 | + const clone = await readFile(join(pyrex.path, "README.md"), "utf8"); |
| 76 | + expect(clone).toEqual("hi"); |
| 77 | + }); |
72 | 78 | });
|
73 | 79 |
|
74 | 80 | afterAll(after);
|
0 commit comments