From 6c725438cca1ac9376aec57d594726a0e7fc71e2 Mon Sep 17 00:00:00 2001 From: Tom Boucher Date: Sun, 5 Jul 2026 18:01:28 -0400 Subject: [PATCH] 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 --- tests/gate-predicate-evaluator.test.cjs | 2 -- tests/surface-empty-manifest-agents.test.cjs | 3 ++- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/tests/gate-predicate-evaluator.test.cjs b/tests/gate-predicate-evaluator.test.cjs index d3e2579a1..7d5c9fb39 100644 --- a/tests/gate-predicate-evaluator.test.cjs +++ b/tests/gate-predicate-evaluator.test.cjs @@ -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, diff --git a/tests/surface-empty-manifest-agents.test.cjs b/tests/surface-empty-manifest-agents.test.cjs index ba884511b..9d5aa36cc 100644 --- a/tests/surface-empty-manifest-agents.test.cjs +++ b/tests/surface-empty-manifest-agents.test.cjs @@ -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());