From eb900ddd81c980d445ce3e42997bdcd62d72a612 Mon Sep 17 00:00:00 2001 From: Affaan Mustafa Date: Wed, 15 Apr 2026 19:33:34 -0700 Subject: [PATCH] test: align hook install expectations with Claude schema --- tests/scripts/install-apply.test.js | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/tests/scripts/install-apply.test.js b/tests/scripts/install-apply.test.js index 9130a9ad..4943ef93 100644 --- a/tests/scripts/install-apply.test.js +++ b/tests/scripts/install-apply.test.js @@ -363,25 +363,25 @@ function runTests() { const installedBashDispatcherEntry = installedHooks.hooks.PreToolUse.find(entry => entry.id === 'pre:bash:dispatcher'); assert.ok(installedBashDispatcherEntry, 'hooks/hooks.json should include the consolidated Bash dispatcher hook'); - assert.ok(Array.isArray(installedBashDispatcherEntry.hooks[0].command), 'hooks/hooks.json should install argv-form commands for cross-platform safety'); + assert.strictEqual(typeof installedBashDispatcherEntry.hooks[0].command, 'string', 'hooks/hooks.json should install string-form commands for Claude Code schema compatibility'); assert.ok( - installedBashDispatcherEntry.hooks[0].command[0] === 'node' && installedBashDispatcherEntry.hooks[0].command[1] === '-e', + installedBashDispatcherEntry.hooks[0].command.startsWith('node -e '), 'hooks/hooks.json should use the inline node bootstrap contract' ); assert.ok( - installedBashDispatcherEntry.hooks[0].command.some(part => String(part).includes('plugin-hook-bootstrap.js')), + installedBashDispatcherEntry.hooks[0].command.includes('plugin-hook-bootstrap.js'), 'hooks/hooks.json should route plugin-managed hooks through the shared bootstrap' ); assert.ok( - installedBashDispatcherEntry.hooks[0].command.some(part => String(part).includes('CLAUDE_PLUGIN_ROOT')), + installedBashDispatcherEntry.hooks[0].command.includes('CLAUDE_PLUGIN_ROOT'), 'hooks/hooks.json should still consult CLAUDE_PLUGIN_ROOT for runtime resolution' ); assert.ok( - installedBashDispatcherEntry.hooks[0].command.some(part => String(part).includes('pre-bash-dispatcher.js')), + installedBashDispatcherEntry.hooks[0].command.includes('pre-bash-dispatcher.js'), 'hooks/hooks.json should point the Bash preflight contract at the consolidated dispatcher' ); assert.ok( - !installedBashDispatcherEntry.hooks[0].command.some(part => String(part).includes('${CLAUDE_PLUGIN_ROOT}')), + !installedBashDispatcherEntry.hooks[0].command.includes('${CLAUDE_PLUGIN_ROOT}'), 'hooks/hooks.json should not retain raw CLAUDE_PLUGIN_ROOT shell placeholders after install' ); } finally {