From e8b4c61873f6e137175e543985d215bf5281c407 Mon Sep 17 00:00:00 2001 From: BIackFIame <77388790+BIackFIame@users.noreply.github.com> Date: Thu, 22 Oct 2026 09:16:29 +0000 Subject: [PATCH] test: ignore the checkout path in the session store's secret-word check "terminal window descriptors persist atomically without scrollback or environment" saves a descriptor whose cwd is process.cwd() and then checks the whole file against /buffer|environment|capability|token/. Run from a checkout whose path contains one of those words (for example a worktree named after an environments feature), the cwd alone matched and the test failed on every run. The check now leaves the descriptor's own cwd value out; everything else in the file is checked as before. --- tests/terminal-session-store.test.mjs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tests/terminal-session-store.test.mjs b/tests/terminal-session-store.test.mjs index ab8dc7e06..fc778fecf 100644 --- a/tests/terminal-session-store.test.mjs +++ b/tests/terminal-session-store.test.mjs @@ -29,7 +29,8 @@ test("terminal window descriptors persist atomically without scrollback or envir const store = new TerminalSessionStore(directory); await store.replace([descriptor]); const raw = await readFile(store.filePath, "utf8"); - assert.doesNotMatch(raw, /buffer|environment|capability|token/u); + // The checkout folder is the descriptor's cwd; leave it out so a path like ~/environment/... cannot match. + assert.doesNotMatch(raw.split(JSON.stringify(descriptor.cwd)).join('""'), /buffer|environment|capability|token/u); const reloaded = new TerminalSessionStore(directory); assert.deepEqual(await reloaded.load(), [descriptor]);