Files
zerobyte/app/client/lib/volume-path.test.ts
Nico 4305057185 test: move test runner from Bun to Vitest (#727)
* 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
2026-04-01 20:05:54 +02:00

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");
});
});