From 0f0c6d0850180ed85ee580e311c0308ca2237a20 Mon Sep 17 00:00:00 2001 From: YeonGyu-Kim Date: Thu, 28 May 2026 15:04:59 +0900 Subject: [PATCH] test(package): harden layout exclusion fixtures --- script/package-layout-exclusion.test.ts | 20 +++++++++++++++++--- 1 file changed, 17 insertions(+), 3 deletions(-) diff --git a/script/package-layout-exclusion.test.ts b/script/package-layout-exclusion.test.ts index 1fb0e37d3..f34fd6e0e 100644 --- a/script/package-layout-exclusion.test.ts +++ b/script/package-layout-exclusion.test.ts @@ -150,7 +150,18 @@ function writeFakeInternalArtifacts(packagePaths: readonly string[]): void { for (const packagePath of packagePaths) { const artifactPath = join(repositoryRoot, packagePath) mkdirSync(dirname(artifactPath), { recursive: true }) - writeFileSync(artifactPath, "# Fake internal artifact for package-layout-exclusion.test.ts\n") + const content = packagePath.endsWith("/SKILL.md") + ? [ + "---", + `name: ${fakeArtifactName}`, + "description: Internal fake skill artifact for package layout exclusion tests.", + "---", + "", + "# Fake internal artifact for package-layout-exclusion.test.ts", + "", + ].join("\n") + : "# Fake internal artifact for package-layout-exclusion.test.ts\n" + writeFileSync(artifactPath, content) } } @@ -183,6 +194,9 @@ describe("published package layout exclusions", () => { test("#given internal-only skill assets #when packing package #then forbidden skill assets do not ship", async () => { // given expect(collectExistingFakeInternalSkillArtifactPaths()).toEqual(fakeInternalSkillArtifactPaths.toSorted()) + for (const packagePath of fakeInternalSkillArtifactPaths) { + expect(readFileSync(join(repositoryRoot, packagePath), "utf8")).toStartWith("---\n") + } // when const packedPaths = await packDryRunPaths() @@ -190,7 +204,7 @@ describe("published package layout exclusions", () => { // then const packedInternalSkillPaths = fakeInternalSkillArtifactPaths.filter((packagePath) => packedPaths.has(packagePath)) expect(packedInternalSkillPaths).toEqual([]) - }) + }, { timeout: 20_000 }) test("#given internal-only command assets #when packing package #then forbidden command assets do not ship", async () => { // given @@ -204,5 +218,5 @@ describe("published package layout exclusions", () => { // then const packedInternalCommandPaths = fakeInternalCommandArtifactPaths.filter((packagePath) => packedPaths.has(packagePath)) expect(packedInternalCommandPaths).toEqual([]) - }) + }, { timeout: 20_000 }) })