Skip to content

Commit b466f60

Browse files
committed
fix(agents): widen file.name to string before comparison to satisfy lint
Lint flagged String(file.name) as 'type conversion does not change the type or value'. Widen via .map((f) => f.name): string[] for the .includes check, and use file.name as string for the .find predicate.
1 parent c9774b1 commit b466f60

1 file changed

Lines changed: 5 additions & 3 deletions

File tree

src/agents/bootstrap-files.test.ts

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -187,9 +187,11 @@ describe("resolveBootstrapFilesForRun", () => {
187187
// Workspace AGENTS.md is suppressed (skipBootstrap), but hook-injected
188188
// EXTRA.md still appears. WorkspaceBootstrapFileName is a typed union of
189189
// canonical bootstrap names; hooks can inject arbitrary file names so
190-
// compare via String() to keep the assertion type-portable.
191-
expect(files.some((file) => String(file.name) === "AGENTS.md")).toBe(false);
192-
const extra = files.find((file) => String(file.name) === "EXTRA.md");
190+
// widen each name to string before comparing to keep the assertion
191+
// type-portable without forcing the union to admit hook-only names.
192+
const fileNames: string[] = files.map((file) => file.name);
193+
expect(fileNames.includes("AGENTS.md")).toBe(false);
194+
const extra = files.find((file) => (file.name as string) === "EXTRA.md");
193195
expect(extra?.content).toBe("extra");
194196
});
195197

0 commit comments

Comments
 (0)