repositories / pi-ext

pi-ext

bugabingas pi extensions

owned by bugabinga

extensions/web/__tests__/harness.test.ts

Raw
File outline
import path from "node:path";
import { afterEach, describe, expect, it } from "vitest";
import { createTestSession, type TestSession } from "../../../test/harness";

describe("web extension harness", () => {
	let t: TestSession | undefined;
	afterEach(() => t?.dispose());

	it("registers web_fetch, web_map, web_search, and understand_image tools", async () => {
		const webPath = path.resolve(import.meta.dirname, "../index.ts");
		t = await createTestSession({ extensions: [webPath] });

		const [extension] = t.session.extensionRunner.extensions;
		expect([...extension.tools.keys()]).toContain("web_fetch");
		expect([...extension.tools.keys()]).toContain("web_map");
		expect([...extension.tools.keys()]).toContain("web_search");
		expect([...extension.tools.keys()]).toContain("understand_image");
	});
});