Skip to content

armgit / kokon

Public Imported from GitHub
0

Edit photos by describing the change, on your own GPU. A free, open-source alternative to Nano Banana and ChatGPT image editing: photos stay on your computer, no daily limit. One installer for Windows, Mac and Linux sets up the best open model (Qwen-Image 2.1). MCP server for AI agents.

MCP protocol test: expect the app version from package.json instead of a fixed one

Gabriele Lozuponec775ab91eab8
diff --git a/mcp/test/protocol.test.ts b/mcp/test/protocol.test.ts
index 4aef115..ae745ea 100644
--- a/mcp/test/protocol.test.ts
+++ b/mcp/test/protocol.test.ts
@@ -8,6 +8,8 @@ import { StdioClientTransport } from "@modelcontextprotocol/sdk/client/stdio.js"
import { afterAll, beforeAll, describe, expect, it } from "vitest";
const root = path.resolve(__dirname, "..", "..");
+// The app version (kept equal in package.json, Cargo.toml and tauri.conf.json at every release).
+const appVersion: string = JSON.parse(fs.readFileSync(path.join(root, "package.json"), "utf8")).version;
const serviceExe = process.platform === "win32" ? "kokon-service.exe" : "kokon-service";
// The most recently built service (debug or release), so a stale build is not tested.
const serviceBuild = ["debug", "release"]
@@ -66,7 +68,7 @@ describe("MCP protocol", () => {
const s = r.structuredContent as Record<string, unknown>;
expect(s).toHaveProperty("server_running");
expect(s).toHaveProperty("model_loaded");
- expect(s.service_version).toBe("0.9.0");
+ expect(s.service_version).toBe(appVersion);
}, 60_000);
it("get_image_info reads a project image and blocks paths outside", async () => {