mirror of
https://github.com/affaan-m/everything-claude-code.git
synced 2026-04-05 08:43:29 +08:00
test: add 3 tests for suggest-compact, session-aliases, typecheck (Round 64)
- suggest-compact: 'default' session ID fallback when CLAUDE_SESSION_ID empty - session-aliases: loadAliases backfills missing version and metadata fields - post-edit-typecheck: valid JSON without tool_input passes through unchanged Total: 797 tests, all passing
This commit is contained in:
@@ -2999,6 +2999,19 @@ async function runTests() {
|
||||
'Should pass through data unchanged when tool_input is absent');
|
||||
})) passed++; else failed++;
|
||||
|
||||
// ── Round 64: post-edit-typecheck.js valid JSON without tool_input ──
|
||||
console.log('\nRound 64: post-edit-typecheck.js (valid JSON without tool_input):');
|
||||
|
||||
if (await asyncTest('skips typecheck when JSON has no tool_input field', async () => {
|
||||
const stdinJson = JSON.stringify({ result: 'ok', metadata: { action: 'test' } });
|
||||
const result = await runScript(path.join(scriptsDir, 'post-edit-typecheck.js'), stdinJson);
|
||||
|
||||
assert.strictEqual(result.code, 0, 'Should exit 0 for JSON without tool_input');
|
||||
// input.tool_input?.file_path is undefined → skips TS check → passes through
|
||||
assert.strictEqual(result.stdout, stdinJson,
|
||||
'Should pass through data unchanged when tool_input is absent');
|
||||
})) passed++; else failed++;
|
||||
|
||||
// Summary
|
||||
console.log('\n=== Test Results ===');
|
||||
console.log(`Passed: ${passed}`);
|
||||
|
||||
Reference in New Issue
Block a user