Download src/cli/daemon-cli-compat.test.ts from shimen/shinclaw: direct link, hf CLI and curl.
- Browser
- Download file 1.6 kB
-
https://huggingface.co/spaces/shimen/shinclaw/resolve/main/src/cli/daemon-cli-compat.test.ts
- Command line
-
hf download hf://spaces/shimen/shinclaw/src/cli/daemon-cli-compat.test.ts
-
curl -L -o daemon-cli-compat.test.ts https://huggingface.co/spaces/shimen/shinclaw/resolve/main/src/cli/daemon-cli-compat.test.ts
1.6 kB
| import { describe, expect, it } from "vitest"; | |
| import { resolveLegacyDaemonCliAccessors } from "./daemon-cli-compat.js"; | |
| describe("resolveLegacyDaemonCliAccessors", () => { | |
| it("resolves aliased daemon-cli exports from a bundled chunk", () => { | |
| const bundle = ` | |
| var daemon_cli_exports = /* @__PURE__ */ __exportAll({ registerDaemonCli: () => registerDaemonCli }); | |
| export { runDaemonStop as a, runDaemonStart as i, runDaemonStatus as n, runDaemonUninstall as o, runDaemonRestart as r, runDaemonInstall as s, daemon_cli_exports as t }; | |
| `; | |
| expect(resolveLegacyDaemonCliAccessors(bundle)).toEqual({ | |
| registerDaemonCli: "t.registerDaemonCli", | |
| runDaemonInstall: "s", | |
| runDaemonRestart: "r", | |
| runDaemonStart: "i", | |
| runDaemonStatus: "n", | |
| runDaemonStop: "a", | |
| runDaemonUninstall: "o", | |
| }); | |
| }); | |
| it("returns null when required aliases are missing", () => { | |
| const bundle = ` | |
| var daemon_cli_exports = /* @__PURE__ */ __exportAll({ registerDaemonCli: () => registerDaemonCli }); | |
| export { runDaemonRestart as r, daemon_cli_exports as t }; | |
| `; | |
| expect(resolveLegacyDaemonCliAccessors(bundle)).toEqual({ | |
| registerDaemonCli: "t.registerDaemonCli", | |
| runDaemonRestart: "r", | |
| }); | |
| }); | |
| it("returns null when the required restart alias is missing", () => { | |
| const bundle = ` | |
| var daemon_cli_exports = /* @__PURE__ */ __exportAll({ registerDaemonCli: () => registerDaemonCli }); | |
| export { daemon_cli_exports as t }; | |
| `; | |
| expect(resolveLegacyDaemonCliAccessors(bundle)).toBeNull(); | |
| }); | |
| }); | |