mirror of
https://github.com/heygen-com/hyperframes.git
synced 2026-11-18 07:50:13 +00:00
* fix(cli): every settings file follows HYPERFRAMES_CONFIG_DIR * fix(cli): the media-use skill copy reads its config from HYPERFRAMES_CONFIG_DIR too * test(cli): expect the config folder as a normalized path on every platform * chore(skills): refresh the media-use manifest hash * fix(cli): a moved settings folder starts from ~/.hyperframes, keeping an opt-out * fix(cli): drop the updater's unused path import * style(cli): keep the settings-seed comment under 120 characters
41 lines
1.4 KiB
TypeScript
41 lines
1.4 KiB
TypeScript
import { afterEach, beforeEach, describe, expect, it, vi } from "vitest";
|
|
import { homedir } from "node:os";
|
|
import { join } from "node:path";
|
|
import { CREDENTIAL_FILENAME, configDir, credentialPath } from "./paths.js";
|
|
|
|
describe("auth/paths", () => {
|
|
const original = process.env["HYPERFRAMES_CONFIG_DIR"];
|
|
|
|
beforeEach(() => {
|
|
delete process.env["HYPERFRAMES_CONFIG_DIR"];
|
|
});
|
|
|
|
afterEach(() => {
|
|
vi.unstubAllEnvs();
|
|
if (original !== undefined) process.env["HYPERFRAMES_CONFIG_DIR"] = original;
|
|
else delete process.env["HYPERFRAMES_CONFIG_DIR"];
|
|
});
|
|
|
|
it("defaults to ~/.hyperframes", () => {
|
|
expect(configDir()).toBe(join(homedir(), ".hyperframes"));
|
|
});
|
|
|
|
it("honors HYPERFRAMES_CONFIG_DIR override", () => {
|
|
process.env["HYPERFRAMES_CONFIG_DIR"] = "/tmp/some-test-dir";
|
|
expect(configDir()).toBe(join("/tmp/some-test-dir"));
|
|
expect(credentialPath()).toBe(join("/tmp/some-test-dir", CREDENTIAL_FILENAME));
|
|
});
|
|
|
|
it("treats empty HYPERFRAMES_CONFIG_DIR as unset", () => {
|
|
process.env["HYPERFRAMES_CONFIG_DIR"] = "";
|
|
expect(configDir()).toBe(join(homedir(), ".hyperframes"));
|
|
});
|
|
|
|
it("ignores the HeyGen CLI directory and isolates the dev environment", () => {
|
|
vi.stubEnv("HEYGEN_CONFIG_DIR", "/tmp/heygen-other-account");
|
|
expect(configDir()).toBe(join(homedir(), ".hyperframes"));
|
|
vi.stubEnv("HYPERFRAMES_ENV", "dev");
|
|
expect(configDir()).toBe(join(homedir(), ".hyperframes", "dev"));
|
|
});
|
|
});
|