dbb7885ffd
CI / check (pull_request) Failing after 1m39s
- Auto-fix: import sorting, formatting (17 files) - Unsafe auto-fix: unused vars, template literals (7 files) - Manual: nursery/noConsole → suspicious/noConsole suppression - Manual: suppress noExcessiveCognitiveComplexity for cmdThreadResume and parseWorkflowPayload - Manual: remove unused destructured vars in current-role tests Closes #48
30 lines
858 B
TypeScript
30 lines
858 B
TypeScript
import { homedir } from "node:os";
|
|
import { describe, expect, it } from "vitest";
|
|
import {
|
|
getDefaultStorageRoot,
|
|
getDefaultWorkflowStorageRoot,
|
|
getGlobalCasDir,
|
|
} from "../src/storage-root.js";
|
|
|
|
describe("getDefaultStorageRoot", () => {
|
|
it("returns homedir + /.uwf", () => {
|
|
expect(getDefaultStorageRoot()).toBe(`${homedir()}/.uwf`);
|
|
});
|
|
});
|
|
|
|
describe("getDefaultWorkflowStorageRoot", () => {
|
|
it("returns same as getDefaultStorageRoot (deprecated alias)", () => {
|
|
expect(getDefaultWorkflowStorageRoot()).toBe(getDefaultStorageRoot());
|
|
});
|
|
});
|
|
|
|
describe("getGlobalCasDir", () => {
|
|
it("appends /cas to given storage root", () => {
|
|
expect(getGlobalCasDir("/tmp/test")).toBe("/tmp/test/cas");
|
|
});
|
|
|
|
it("falls back to default when undefined", () => {
|
|
expect(getGlobalCasDir(undefined)).toBe(`${homedir()}/.uwf/cas`);
|
|
});
|
|
});
|