fix(#2018): use helpers.cleanup() not raw fs.rmSync in surface test; drop unused imports (#2033)

The #2018 regression test used raw fs.rmSync() in afterEach, tripping the
local/no-raw-rmsync-in-tests eslint rule (Windows-EBUSY retry budget). CI's
lint-tests job (no eslint cache) caught it on next; local --cache runs had
false-greened it. Switch to helpers.cleanup(). Also drop two unused
destructured imports (evaluateCommandExitZero, interpolate) in the
gate-predicate-evaluator test that emitted no-unused-vars warnings.

Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
Tom Boucher
2026-07-05 18:01:28 -04:00
committed by GitHub
parent f77179248d
commit 6c725438cc
2 changed files with 2 additions and 3 deletions

View File

@@ -22,8 +22,6 @@ const fc = require('fast-check');
const {
evaluatePredicate,
evaluateCommandExitZero,
interpolate,
COMMAND_EXIT_ZERO_DEFAULT_TIMEOUT_MS,
COMMAND_MAX_OUTPUT_CHARS,
COMMAND_MAX_LENGTH,

View File

@@ -13,6 +13,7 @@ const os = require('os');
const path = require('path');
const { _syncGsdDir } = require('../gsd-core/bin/lib/surface.cjs');
const { cleanup } = require('./helpers.cjs');
function tmp() { return fs.mkdtempSync(path.join(os.tmpdir(), 'gsd-surface-empty-')); }
@@ -26,7 +27,7 @@ describe('#2018 — empty manifest must not delete gsd-* agents', () => {
}
// Staged dir is EMPTY (unresolvable manifest → nothing staged)
});
afterEach(() => { try { fs.rmSync(dest, { recursive: true, force: true }); } catch {} try { fs.rmSync(staged, { recursive: true, force: true }); } catch {} });
afterEach(() => { cleanup(dest); cleanup(staged); });
test('empty manifest → agents preserved (not deleted)', () => {
_syncGsdDir(staged, dest, 'agents', new Map());