21 lines
626 B
TypeScript
21 lines
626 B
TypeScript
import test from "node:test";
|
|
import assert from "node:assert/strict";
|
|
import webSearchExtension from "../index.ts";
|
|
|
|
test("the extension entrypoint registers both tools and the config command", () => {
|
|
const registeredTools: string[] = [];
|
|
const registeredCommands: string[] = [];
|
|
|
|
webSearchExtension({
|
|
registerTool(tool: { name: string }) {
|
|
registeredTools.push(tool.name);
|
|
},
|
|
registerCommand(name: string) {
|
|
registeredCommands.push(name);
|
|
},
|
|
} as any);
|
|
|
|
assert.deepEqual(registeredTools, ["web_search", "web_fetch"]);
|
|
assert.deepEqual(registeredCommands, ["web-search-config"]);
|
|
});
|