Skip to content

Commit d7388c6

Browse files
cliffhallclaude
andcommitted
test(memory): expect Node 26's path-suffixed EISDIR message
Node 26 appends the file path to the EISDIR read error, so the exact-match assertion in persistence.test.ts failed there. Expect the suffixed text on Node 26 and later and the bare text before, keeping the exact match. Co-Authored-By: Claude Opus 5.5 <[email protected]> Signed-off-by: cliffhall <[email protected]>
1 parent 0763da6 commit d7388c6

1 file changed

Lines changed: 6 additions & 3 deletions

File tree

‎src/memory/__tests__/persistence.test.ts‎

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -211,6 +211,11 @@ describe("memory persistence over the protocol", () => {
211211
// which is not the ENOENT that means "no graph yet".
212212
await fs.mkdir(filePath);
213213
const { client } = await open();
214+
// Node 26 appends the path to the message; earlier versions do not
215+
// (#5076). The server passes Node's message through either way.
216+
const bare = "EISDIR: illegal operation on a directory, read";
217+
const nodeMajor = Number(process.versions.node.split(".")[0]);
218+
const expected = nodeMajor >= 26 ? `${bare} '${filePath}'` : bare;
214219

215220
for (const [name, args] of [
216221
["read_graph", {}],
@@ -220,9 +225,7 @@ describe("memory persistence over the protocol", () => {
220225
] as const) {
221226
const result = await call(client, name, args);
222227
expect(result.isError).toBe(true);
223-
expect(textOf(result)).toBe(
224-
"EISDIR: illegal operation on a directory, read",
225-
);
228+
expect(textOf(result)).toBe(expected);
226229
}
227230
await expect(
228231
client.readResource({ uri: "memory://knowledge-graph" }),

0 commit comments

Comments
 (0)