mirror of
https://github.com/affaan-m/everything-claude-code.git
synced 2026-03-30 13:43:26 +08:00
fix: typecheck hook false positives, add 11 session-manager tests
- Fix post-edit-typecheck.js error filtering: use relative/absolute path matching instead of basename, preventing false positives when multiple files share the same name (e.g., src/utils.ts vs tests/utils.ts) - Add writeSessionContent tests (create, overwrite, invalid path) - Add appendSessionContent test (append to existing file) - Add deleteSession tests (delete existing, non-existent) - Add sessionExists tests (file, non-existent, directory) - Add getSessionStats empty content edge case - Add post-edit-typecheck stdout passthrough test - Total: 391 → 402 tests, all passing
This commit is contained in:
@@ -639,6 +639,18 @@ async function runTests() {
|
||||
cleanupTestDir(testDir);
|
||||
})) passed++; else failed++;
|
||||
|
||||
if (await asyncTest('passes through stdin data on stdout (post-edit-typecheck)', async () => {
|
||||
const testDir = createTestDir();
|
||||
const testFile = path.join(testDir, 'test.ts');
|
||||
fs.writeFileSync(testFile, 'const x: number = 1;');
|
||||
|
||||
const stdinJson = JSON.stringify({ tool_input: { file_path: testFile } });
|
||||
const result = await runScript(path.join(scriptsDir, 'post-edit-typecheck.js'), stdinJson);
|
||||
assert.strictEqual(result.code, 0);
|
||||
assert.ok(result.stdout.includes('tool_input'), 'Should pass through stdin data on stdout');
|
||||
cleanupTestDir(testDir);
|
||||
})) passed++; else failed++;
|
||||
|
||||
// session-end.js extractSessionSummary tests
|
||||
console.log('\nsession-end.js (extractSessionSummary):');
|
||||
|
||||
|
||||
Reference in New Issue
Block a user