test(manifest): read README at test time; tighten npm pack assertions; fix ellipsis in tool description

This commit is contained in:
pi
2026-04-11 02:14:13 +01:00
parent 439cd89c27
commit 42b1ef6e2c
2 changed files with 5 additions and 4 deletions

View File

@@ -336,7 +336,8 @@ export default function question(pi: ExtensionAPI) {
name: "question",
label: "Question",
description:
"Ask the user one or more multiple-choice questions. Every question automatically gets a final Something else option for free-text answers.",
"Ask the user one or more multiple-choice questions. Every question automatically gets a final Something else... option for free-text answers.",
parameters: QuestionParams,
async execute(_toolCallId, params, _signal, _onUpdate, ctx) {

View File

@@ -7,7 +7,7 @@ import { fileURLToPath } from "node:url";
const packageRoot = dirname(fileURLToPath(import.meta.url));
const pkg = JSON.parse(readFileSync(resolve(packageRoot, "package.json"), "utf8"));
const readme = readFileSync(resolve(packageRoot, "README.md"), "utf8");
function getPackedPaths() {
const output = execFileSync("npm", ["pack", "--dry-run", "--json"], {
@@ -49,6 +49,7 @@ test("package.json exposes pi-question as a standalone pi package", () => {
});
test("README documents local and git installation", () => {
const readme = readFileSync(resolve(packageRoot, "README.md"), "utf8");
assert.match(readme, /pi install \/absolute\/path\/to\/question/);
assert.match(readme, /pi install https:\/\/gitea\.rwiesner\.com\/pi\/pi-question/);
});
@@ -56,8 +57,7 @@ test("README documents local and git installation", () => {
test("npm pack includes runtime package assets", () => {
const packedPaths = getPackedPaths();
assert.ok(packedPaths.includes("README.md"));
assert.ok(packedPaths.includes("package.json"));
assert.ok(packedPaths.includes("index.ts"));
assert.ok(packedPaths.includes("question-core.mjs"));
assert.deepEqual(packedPaths.filter((p) => p.endsWith('.test.mjs')), []);
});