test: add tsconfig depth limit and cleanupAliases exception tests

- post-edit-typecheck: verify 25-level-deep directory completes without
  hanging (tests the max depth=20 walk-up guard)
- cleanupAliases: document behavior when sessionExists callback throws
  (propagates to caller, which is acceptable)
This commit is contained in:
Affaan Mustafa
2026-02-13 01:10:30 -08:00
parent 307ee05b2d
commit a4848da38b
2 changed files with 42 additions and 0 deletions

View File

@@ -402,6 +402,27 @@ function runTests() {
assert.ok(result.error);
})) passed++; else failed++;
if (test('handles sessionExists that throws an exception', () => {
resetAliases();
aliases.setAlias('bomb', '/path/bomb');
aliases.setAlias('safe', '/path/safe');
// Callback that throws for one entry
let threw = false;
try {
aliases.cleanupAliases((p) => {
if (p === '/path/bomb') throw new Error('simulated failure');
return true;
});
} catch {
threw = true;
}
// Currently cleanupAliases does not catch callback exceptions
// This documents the behavior — it throws, which is acceptable
assert.ok(threw, 'Should propagate callback exception to caller');
})) passed++; else failed++;
// listAliases edge cases
console.log('\nlistAliases (edge cases):');