From fd311693f690b848e65a62653c3979bc861cb806 Mon Sep 17 00:00:00 2001 From: esengine <359807859@qq.com> Date: Tue, 13 Oct 2026 09:50:46 -0700 Subject: [PATCH] test(release): read the fragment directory's notes too and skip directories --- scripts/markdown-refs.test.mjs | 2 +- scripts/studio-release-notes.test.mjs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/scripts/markdown-refs.test.mjs b/scripts/markdown-refs.test.mjs index 7ae5b2c12d..3d850a5f01 100644 --- a/scripts/markdown-refs.test.mjs +++ b/scripts/markdown-refs.test.mjs @@ -58,7 +58,7 @@ test("HTML comments hide references on one line or across several", () => { test("annotating leaves every other byte in place", async () => { const dir = new URL("../release-notes/studio/", import.meta.url); - for (const name of await readdir(dir)) { + for (const name of (await readdir(dir, { recursive: true })).filter((entry) => entry.endsWith(".md"))) { const source = await readFile(new URL(name, dir), "utf8"); assert.equal(annotateMarkdown(source, () => ""), source, name); assert.equal(annotateMarkdown(source, tag).replace(/<\d+>/g, ""), source, name); diff --git a/scripts/studio-release-notes.test.mjs b/scripts/studio-release-notes.test.mjs index e521bbec7b..6eabf95e87 100644 --- a/scripts/studio-release-notes.test.mjs +++ b/scripts/studio-release-notes.test.mjs @@ -62,7 +62,7 @@ test("an unresolved ref stays plain and is reported by code", async () => { test("committed notes render unchanged when nothing is credited", async () => { const dir = new URL("../release-notes/studio/", import.meta.url); - for (const name of await readdir(dir)) { + for (const name of (await readdir(dir, { recursive: true })).filter((entry) => entry.endsWith(".md"))) { const source = await readFile(new URL(name, dir), "utf8"); assert.equal(renderStudioNotes(source, new Map()), `${source.trimEnd()}\n`, name); }