fix(ci): resolve ubuntu check regressions
This commit is contained in:
@@ -9,7 +9,7 @@
|
||||
*/
|
||||
|
||||
import assert from "node:assert/strict";
|
||||
import { mkdtemp, mkdir, writeFile, rm } from "node:fs/promises";
|
||||
import { mkdtemp, mkdir, writeFile, rm, readFile } from "node:fs/promises";
|
||||
import crypto from "node:crypto";
|
||||
import { tmpdir } from "node:os";
|
||||
import path from "node:path";
|
||||
@@ -25,6 +25,7 @@ const {
|
||||
makePackageJsonContent,
|
||||
getGeneratedRoots,
|
||||
buildManifest,
|
||||
generateSkills,
|
||||
} = await import(`${SCRIPTS_DIR}/generate-skills.mjs`);
|
||||
|
||||
// ── detectFileType ────────────────────────────────────────────────────────
|
||||
@@ -348,3 +349,17 @@ test("buildManifest: sha256 matches actual file content", async () => {
|
||||
await rm(dir, { recursive: true, force: true });
|
||||
}
|
||||
});
|
||||
|
||||
test("generateSkills: clears pre-existing empty generated directories without EISDIR", async () => {
|
||||
const targetRoot = await mkdtemp(path.join(tmpdir(), "generate-skills-target-"));
|
||||
try {
|
||||
await mkdir(path.join(targetRoot, "skills", "create-plan", "claude-code", "templates"), { recursive: true });
|
||||
|
||||
await generateSkills(path.resolve(SCRIPTS_DIR, ".."), { targetRoot });
|
||||
|
||||
await readFile(path.join(targetRoot, "skills", "create-plan", "claude-code", "SKILL.md"), "utf8");
|
||||
await readFile(path.join(targetRoot, "skills", "create-plan", "claude-code", "templates", "milestone-plan.md"), "utf8");
|
||||
} finally {
|
||||
await rm(targetRoot, { recursive: true, force: true });
|
||||
}
|
||||
});
|
||||
|
||||
@@ -404,7 +404,7 @@ test("cli exits without confirmation when no operations are planned", () => {
|
||||
const output = execFileSync(process.execPath, [
|
||||
path.join(REPO_ROOT, "scripts", "manage-skills.mjs"),
|
||||
"--answers",
|
||||
"/dev/stdin",
|
||||
"-",
|
||||
], {
|
||||
cwd: REPO_ROOT,
|
||||
encoding: "utf8",
|
||||
|
||||
Reference in New Issue
Block a user