mirror of
https://github.com/openclaw/openclaw.git
synced 2026-04-21 06:02:13 +00:00
43 lines
1.2 KiB
TypeScript
43 lines
1.2 KiB
TypeScript
import { describe, expect, it } from "vitest";
|
|
import { buildWorkspaceSkillStatus } from "./skills-status.js";
|
|
import type { SkillEntry } from "./skills/types.js";
|
|
|
|
describe("buildWorkspaceSkillStatus", () => {
|
|
it("does not surface install options for OS-scoped skills on unsupported platforms", () => {
|
|
if (process.platform === "win32") {
|
|
// Keep this simple; win32 platform naming is already explicitly handled elsewhere.
|
|
return;
|
|
}
|
|
|
|
const mismatchedOs = process.platform === "darwin" ? "linux" : "darwin";
|
|
|
|
const entry: SkillEntry = {
|
|
skill: {
|
|
name: "os-scoped",
|
|
description: "test",
|
|
source: "test",
|
|
filePath: "/tmp/os-scoped",
|
|
baseDir: "/tmp",
|
|
},
|
|
frontmatter: {},
|
|
metadata: {
|
|
os: [mismatchedOs],
|
|
requires: { bins: ["fakebin"] },
|
|
install: [
|
|
{
|
|
id: "brew",
|
|
kind: "brew",
|
|
formula: "fake",
|
|
bins: ["fakebin"],
|
|
label: "Install fake (brew)",
|
|
},
|
|
],
|
|
},
|
|
};
|
|
|
|
const report = buildWorkspaceSkillStatus("/tmp/ws", { entries: [entry] });
|
|
expect(report.skills).toHaveLength(1);
|
|
expect(report.skills[0]?.install).toEqual([]);
|
|
});
|
|
});
|