mirror of
https://github.com/nicotsx/zerobyte.git
synced 2026-04-18 05:47:31 -04:00
* refactor: strip out volume path in snapshot list / restore chore: lint issue * test: backups new include patterns
29 lines
730 B
TypeScript
29 lines
730 B
TypeScript
import { describe, expect, test } from "bun:test";
|
|
import { getVolumeMountPath } from "./volume-path";
|
|
import { fromAny } from "@total-typescript/shoehorn";
|
|
|
|
describe("getVolumeMountPath", () => {
|
|
test("returns the configured path for directory volumes", () => {
|
|
const volume = {
|
|
shortId: "abc123",
|
|
config: {
|
|
backend: "directory",
|
|
path: "/mnt/data/projects",
|
|
},
|
|
};
|
|
|
|
expect(getVolumeMountPath(fromAny(volume))).toBe("/mnt/data/projects");
|
|
});
|
|
|
|
test("returns the mounted data path for non-directory volumes", () => {
|
|
const volume = {
|
|
shortId: "vol789",
|
|
config: {
|
|
backend: "nfs",
|
|
},
|
|
};
|
|
|
|
expect(getVolumeMountPath(fromAny(volume))).toBe("/var/lib/zerobyte/volumes/vol789/_data");
|
|
});
|
|
});
|