From 1709267cc699e5976c7103e5fbb468f01ac567d3 Mon Sep 17 00:00:00 2001 From: Cursor Agent Date: Thu, 29 Oct 2026 09:04:38 +0000 Subject: [PATCH] test(firmware): stat raw links without following them access follows a symlink, so a published dangling raw-link still looked absent. lstat and readlink inspect the link itself. --- .../firmware/firmwarePublicationPaths.test.ts | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/tests/boundary/firmware/firmwarePublicationPaths.test.ts b/tests/boundary/firmware/firmwarePublicationPaths.test.ts index 192f67bb23..61b26a3c73 100644 --- a/tests/boundary/firmware/firmwarePublicationPaths.test.ts +++ b/tests/boundary/firmware/firmwarePublicationPaths.test.ts @@ -1,5 +1,13 @@ import { createHash } from "node:crypto"; -import { access, mkdir, readFile, symlink, writeFile } from "node:fs/promises"; +import { + access, + lstat, + mkdir, + readFile, + readlink, + symlink, + writeFile, +} from "node:fs/promises"; import { join } from "node:path"; import { expect, it, vi } from "vitest"; import { Client, InMemoryTransport } from "@modelcontextprotocol/client"; @@ -227,7 +235,9 @@ it("publishes the writer's normalized path while retaining source spelling and u link_target_hex: "73616d706c65efbfbd", }, ]); - await expect(access(join(output, "raw-link"))).rejects.toMatchObject({ + const rawLink = join(output, "raw-link"); + await expect(lstat(rawLink)).rejects.toMatchObject({ code: "ENOENT" }); + await expect(readlink(rawLink)).rejects.toMatchObject({ code: "ENOENT", }); await validateAdvertisedFirmwareOutput(result);