mirror of
https://github.com/nicotsx/zerobyte.git
synced 2026-04-17 21:37:06 -04:00
* chore: migrate to vitest * test: speed up some suites by sharing sessions and mocking expensive non-tested actions * test: refactor some tests to verify behavior instead of implementation details * chore: fix linting issues
29 lines
728 B
TypeScript
29 lines
728 B
TypeScript
import { describe, expect, test } from "vitest";
|
|
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");
|
|
});
|
|
});
|