From e6627dfd77e76c23bc542b0ac90e7e4e89a02bfc Mon Sep 17 00:00:00 2001 From: Tom Boucher Date: Thu, 14 May 2026 13:52:55 -0400 Subject: [PATCH] test(codex): support direct SessionStart hooks in #2698 helper --- tests/bug-2698-crlf-install.test.cjs | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/tests/bug-2698-crlf-install.test.cjs b/tests/bug-2698-crlf-install.test.cjs index 727df7b91..51f56b424 100644 --- a/tests/bug-2698-crlf-install.test.cjs +++ b/tests/bug-2698-crlf-install.test.cjs @@ -102,11 +102,12 @@ function writeCodexConfigWithStaleHooks(dir, headerEol, bodyEol) { ? parsed.hooks : parsed; const sessionStart = Array.isArray(table.SessionStart) ? table.SessionStart : []; - return sessionStart.flatMap((entry) => - (Array.isArray(entry?.hooks) ? entry.hooks : []) - .map((hook) => hook && hook.command) - .filter((cmd) => typeof cmd === 'string') - ); + return sessionStart.flatMap((entry) => [ + ...(typeof entry?.command === 'string' ? [entry.command] : []), + ...(Array.isArray(entry?.hooks) + ? entry.hooks.map((hook) => hook && hook.command).filter((cmd) => typeof cmd === 'string') + : []), + ]); } test('LF config.toml: stale gsd-update-check block removed on reinstall', (t) => {