fix(test): split P5/P6/P10 into one node:test per original check() label Task 1 review found three ported checks collapsed two original labels into one test(), losing the per-assertion granularity the brief's Step 7 requires. Splits P5, P6, and P10 back into two test() blocks each, using the original labels verbatim, with each block doing its own dynamic import after before() sets PI_CODING_AGENT_DIR. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
amankumarsingh77 amankumarsingh7702@gmail.com
Mon, 27 Jul 2026 00:19:46 +0530
1 files changed,
14 insertions(+),
3 deletions(-)
jump to
M
test/profile/store-test.ts
→
test/profile/store-test.ts
@@ -60,13 +60,20 @@ const { readPin, writePin } = await import("../../src/profile/store");
await writePin({ ...pin, profileDir: "Default", label: "Work (work@example.com)" }); const read = await readPin(); assert.equal(read?.profileDir, "Default"); + }); + + test("P5: one pin file on disk", () => { assert.equal(readdirSync(sandbox).filter((f) => f === "browser-harness.json").length, 1); }); - test("P6: clear succeeds and cleared pin reads as none", async () => { - const { readPin, clearPin } = await import("../../src/profile/store"); + test("P6: clear succeeds", async () => { + const { clearPin } = await import("../../src/profile/store"); const cleared = await clearPin(); assert.equal(cleared.success, true); + }); + + test("P6: cleared pin reads as none", async () => { + const { readPin } = await import("../../src/profile/store"); assert.equal(await readPin(), null); });@@ -92,10 +99,14 @@ assert.equal(await readPin(), null);
}); test("P10: write recreates a missing agent dir", async () => { - const { readPin, writePin } = await import("../../src/profile/store"); + const { writePin } = await import("../../src/profile/store"); rmSync(sandbox, { recursive: true, force: true }); const written = await writePin(pin); assert.equal(written.success, true); + }); + + test("P10: pin readable after dir recreation", async () => { + const { readPin } = await import("../../src/profile/store"); assert.equal((await readPin())?.profileDir, "Profile 1"); });