@fungi.computer/parakeet-testing

中文文档
0.2.27发布于 2026/11/15MITTypeScriptES Module近 30 天下载 6171

Test-only garden extension and slash-parity fixtures for a typed Shiitake Session, shared by every Parakeet-protocol renderer's tests

原始使用文档
文档目录7 节
  1. Install or set up
  2. Quick start
  3. Core concepts
  4. API reference
  5. Examples and checks
  6. Limits and errors
  7. Contribute and license

Parakeet Testing (@fungi.computer/parakeet-testing)

Parakeet Testing provides shared fixtures for tests of Parakeet renderers. The fixtures model Shiitake Session activity and one extension catalog so each renderer can exercise the same extension and slash-completion cases.

Install or set up

npm install --save-dev @fungi.computer/parakeet-testing

These are test fixtures, not a runtime dependency of a shipped renderer. Import them from @fungi.computer/parakeet-testing in your renderer's tests.

Quick start

This illustrative example gives a Session a running test extension slot and checks the fixture's response to a command:

import {
  gardenCall,
  gardenExtensionId,
  gardenSlots,
} from "@fungi.computer/parakeet-testing";

const slots = gardenSlots();
const extension = slots[gardenExtensionId];
if (extension?.status !== "running") throw new Error("Fixture is not running");

const reply = await gardenCall("water", { bed: "fern" });

The fixture test verifies slot construction and the garden reply in test/garden.test.ts. Renderer tests should exercise their own Session and UI seams with these shared inputs.

Core concepts

idleActivity, queuedActivity, and runningActivity create common Session activity states. gardenExtensionId, gardenCatalog, and gardenSlots() provide a running test-garden extension advertising /water. Its gardenCall function answers that command with a choice prompt when no bed is given and a success result when one is provided.

slashParityCases lists composer drafts and the completion rows every renderer should show for built-in commands plus /water. slashParityFlow describes the shared flow: enter /water, choose the fern bed, and receive the success notice.

API reference

See the generated fixture API reference for exported fixtures and types.

Examples and checks

Run the fixture contract tests with:

pnpm --filter @fungi.computer/parakeet-testing test

Consumer tests live with their renderer. This package's test verifies its fixtures; it does not prove every renderer uses them correctly.

Limits and errors

These fixtures model a small extension and a fixed completion flow. They do not provide production Session state, execute real tools, or replace tests of a renderer's own input, completion, and dispatch behavior. The package is not packed for publication.

Contribute and license

Keep shared cases deterministic and suitable for renderer tests. The package declares an MIT license.

版本与发布记录

@fungi.computer/parakeet-testing 共发布 35 个版本,首次发布于 2026/10/17;过去 12 个月发布了 35 个版本。

版本发布日期距今
0.2.27latest2026/11/15今天
0.2.262026/11/15今天
0.2.252026/11/141 天前
0.2.242026/11/141 天前
0.2.232026/11/141 天前
0.2.222026/11/141 天前

关于 @fungi.computer/parakeet-testing 的常见问题

@fungi.computer/parakeet-testing 是什么?

Test-only garden extension and slash-parity fixtures for a typed Shiitake Session, shared by every Parakeet-protocol renderer's tests

如何安装 @fungi.computer/parakeet-testing?

在项目目录运行 npm install @fungi.computer/parakeet-testing,或使用 pnpm add / yarn add / bun add。

@fungi.computer/parakeet-testing 支持 TypeScript 吗?

支持。包内自带 TypeScript 类型声明(package.json 声明了 types 入口),安装后即可获得类型提示,无需再安装 @types 包。

@fungi.computer/parakeet-testing 支持 ESM 还是 CommonJS?

以 ES Module 形式发布,推荐使用 import 引入。在 CommonJS 项目中,Node.js 20.19+ / 22.12+ 可以直接 require() 不含顶层 await 的 ES Module,更早的版本需要改用动态 import()。

@fungi.computer/parakeet-testing 可以商用吗?

@fungi.computer/parakeet-testing 使用 MIT 许可。宽松许可:允许商业使用、修改和再分发,通常只需在分发时保留原版权与许可声明。以上为概括,不构成法律意见,请以许可原文为准。

@fungi.computer/parakeet-testing 的下载量有多少?

根据 npm 官方下载统计,@fungi.computer/parakeet-testing 在 2026/10/16 – 2026/11/14 这 30 天内被下载 6,171 次,日均约 206 次。下载量会把 CI 构建、镜像同步和作为其他包依赖的安装一并计入,适合横向比较热度,不能直接等同于使用人数。

@fungi.computer/parakeet-testing 还在维护吗?

最新版本 0.2.27 发布于 2026/11/15(今天);至今共发布 35 个版本,其中过去 12 个月发布了 35 个;首次发布于 2026/10/17。发布频率只是参考信号:功能稳定的工具可能很少需要更新,建议结合源码仓库的 issue 和提交记录判断。