Publish Claude Code Binaries / Stage and publish binaries (push) Canceled after 0s
Publish Tutti App Runtime / Build darwin-arm64 (push) Canceled after 0s
Publish Tutti App Runtime / Build darwin-amd64 (push) Canceled after 0s
Publish Tutti App Runtime / Build linux-amd64 (push) Canceled after 0s
Publish Tutti App Runtime / Build windows-amd64 (push) Canceled after 0s
Sync Tutti Agent Skills / sync (push) Canceled after 0s
Windows Agent Adapters / Test Windows agent adapters (push) Canceled after 0s
Windows Daemon Adapters / Test Windows daemon adapters (push) Canceled after 0s
Publish Tutti App Runtime / Publish runtime catalog (push) Canceled after 0s
39 lines
1.3 KiB
TypeScript
39 lines
1.3 KiB
TypeScript
import assert from "node:assert/strict";
|
|
import test from "node:test";
|
|
import {
|
|
isDesktopFeatureSupported,
|
|
normalizeDesktopFeatureKeys,
|
|
parseDesktopFeatureAvailability
|
|
} from "./core.ts";
|
|
|
|
test("normalizes a unique deterministic feature key list", () => {
|
|
assert.deepEqual(
|
|
normalizeDesktopFeatureKeys(["workspace.z", "agent.preview"]),
|
|
["agent.preview", "workspace.z"]
|
|
);
|
|
assert.throws(() =>
|
|
normalizeDesktopFeatureKeys(["workspace.z", "workspace.z"])
|
|
);
|
|
assert.throws(() => normalizeDesktopFeatureKeys([" invalid"]));
|
|
});
|
|
|
|
test("distinguishes a missing envelope from an authoritative empty list", () => {
|
|
assert.equal(parseDesktopFeatureAvailability({}), null);
|
|
assert.deepEqual(
|
|
parseDesktopFeatureAvailability({ featureAvailability: { keys: [] } }),
|
|
{ keys: [] }
|
|
);
|
|
assert.throws(() =>
|
|
parseDesktopFeatureAvailability({
|
|
featureAvailability: { keys: [], unexpected: true }
|
|
})
|
|
);
|
|
});
|
|
|
|
test("queries feature support by exact case-sensitive key membership", () => {
|
|
const snapshot = { keys: ["workspace.example"] };
|
|
assert.equal(isDesktopFeatureSupported(snapshot, "workspace.example"), true);
|
|
assert.equal(isDesktopFeatureSupported(snapshot, "Workspace.example"), false);
|
|
assert.equal(isDesktopFeatureSupported(snapshot, "invalid key"), false);
|
|
});
|