aboutsummaryrefslogtreecommitdiff
path: root/test/profile/paths-test.ts
diff options
context:
space:
mode:
authoramankumarsingh77 <amankumarsingh7702@gmail.com>2026-07-28 20:32:57 +0530
committerAman Kumar <145339995+amankumarsingh77@users.noreply.github.com>2026-08-02 19:12:46 +0530
commit34e5cfdcbe29bbb5f2f46ba54eb67903abd9274d (patch)
treef7b421652a7664d97362a308f4a1288cce2ef5b0 /test/profile/paths-test.ts
parent91a2fdeff796bae8e87d9146e2d540550f54dd74 (diff)
refactor(test): strip comment noise
Removes suite banners, section dividers, and test-id markers that restate the test names. Keeps one-line notes for the deleted-binary fixture order, the never-arriving event consumer, the absent-vs-undefined key distinction, the unexpected-method-echo rationale, and the real-browser teardown and Local State flush quirks. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Diffstat (limited to 'test/profile/paths-test.ts')
-rw-r--r--test/profile/paths-test.ts17
1 files changed, 0 insertions, 17 deletions
diff --git a/test/profile/paths-test.ts b/test/profile/paths-test.ts
index feaf7ae..1278446 100644
--- a/test/profile/paths-test.ts
+++ b/test/profile/paths-test.ts
@@ -1,17 +1,8 @@
-/**
- * Unit tests for path resolution — runs on Linux, macOS, and Windows in CI.
- *
- * Only the branch for the host platform can be exercised, so each assertion is
- * guarded by process.platform; the CI matrix is what gives all three coverage.
- *
- * Run: npm test
- */
import { test, describe } from "node:test";
import assert from "node:assert/strict";
import { homedir } from "node:os";
import { join } from "node:path";
-/** Re-import with a fresh module identity so env changes are picked up. */
const freshImport = async (): Promise<typeof import("../../src/profile/paths")> =>
import(`../../src/profile/paths?cache=${Math.random()}`);
@@ -28,7 +19,6 @@ const withEnv = async (key: string, value: string | undefined, fn: () => Promise
};
describe("path resolution", () => {
- // A1: agent dir default and override
test("A1: default agent dir is ~/.pi/agent", async () => {
await withEnv("PI_CODING_AGENT_DIR", undefined, async () => {
const { agentDir } = await freshImport();
@@ -43,8 +33,6 @@ describe("path resolution", () => {
});
});
- // pi's own expandTildePath only understands "~/" — never "~\" — so the agent
- // dir must resolve identically or the pin lands where pi does not look.
test("A1: '~/' in the agent-dir override expands like pi", async () => {
await withEnv("PI_CODING_AGENT_DIR", "~/custom-agent", async () => {
assert.equal((await freshImport()).agentDir(), `${homedir()}/custom-agent`);
@@ -57,7 +45,6 @@ describe("path resolution", () => {
});
});
- // A2: platform candidate list
test("A2: candidates are non-empty on this platform", async () => {
await withEnv("CHROME_USER_DATA_DIR", undefined, async () => {
const dirs = (await freshImport()).userDataDirCandidates();
@@ -133,7 +120,6 @@ describe("path resolution", () => {
});
});
- // A3: %LOCALAPPDATA% redirection is honoured (Windows-only behaviour)
test("A3 win: redirected LOCALAPPDATA is used", { skip: process.platform !== "win32" }, async () => {
await withEnv("LOCALAPPDATA", "D:\\Redirected\\Local", async () => {
const dirs = (await freshImport()).userDataDirCandidates();
@@ -141,8 +127,6 @@ describe("path resolution", () => {
});
});
- // A4: $CHROME_USER_DATA_DIR override leads the list. This value is ours to
- // interpret, so both tilde separators are accepted.
test("A4: env override is first and tilde-expanded", async () => {
await withEnv("CHROME_USER_DATA_DIR", join("~", "my-chrome-data"), async () => {
const dirs = (await freshImport()).userDataDirCandidates();
@@ -157,7 +141,6 @@ describe("path resolution", () => {
});
});
- // A5: browser naming
test("A5: Chrome recognised", async () => {
const { browserNameForUserDataDir } = await freshImport();
assert.equal(browserNameForUserDataDir("/home/u/.config/google-chrome"), "Chrome");