一键导入
server-testing
How tests work in this repo — server-side only, using Node's built-in test runner via tsx. Use when writing, running, or reviewing tests.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
How tests work in this repo — server-side only, using Node's built-in test runner via tsx. Use when writing, running, or reviewing tests.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
基于 SOC 职业分类
Reproduce a research paper / white paper / arXiv result as a Tangle pipeline. Use when the user asks to "reproduce", "replicate", or "implement" a paper, benchmark, or arXiv link as an experiment.
Drive the open-source Tangle CLI (`tangle-cli`) via Bash for local pipeline/component workflows and API-backed run submission, status, logs, and artifacts. Use whenever an agent needs to validate, hydrate, submit, inspect, or debug Tangle pipelines and runs from the command line.
Answer Tangle product, docs, and how-to questions from a local RAG over the TangleML documentation. Use for conceptual / "what is" / "how do I" lookups, not live run or execution data.
TanStack Router patterns for routing, navigation, search params, and layouts. Use when creating routes, navigating, or working with URL state.
Comprehensive Reveal.js reference for building HTML slide decks. Use whenever the user wants to create, revise, or extend a presentation, slide deck, or talk — especially from Markdown — including transitions, Auto-Animate, Mermaid diagrams, animatable SVG, video, backgrounds, fragments, code highlighting, speaker notes, math, themes, configuration, and PDF export.
Gather, vet, and cite sources for a research question. Use when answering factual questions, comparing options, or producing an evidence-backed write-up.
| name | server-testing |
| description | How tests work in this repo — server-side only, using Node's built-in test runner via tsx. Use when writing, running, or reviewing tests. |
Tests in this repo exist in apps/server only, and run on Node's built-in test runner
(node:test) executed through tsx. There is no Vitest, no Playwright, and no frontend test
setup — apps/web has no test runner configured. If frontend testing is added later, document it
here (or in a new skill) and wire it into pnpm validate.
# all server tests (apps/server/src/**/*.test.ts)
pnpm --filter @tangent/server test
# a single file
pnpm --filter @tangent/server exec tsx --test src/path/to/x.test.ts
pnpm validate (turbo run typecheck lint build) does not run tests — run them explicitly when
you touch server code.
src/store/seedBundles.ts → src/store/seedBundles.test.ts.node:test and node:assert/strict. Use test() blocks (this codebase uses test,
not describe/it)..ts extensions (matching the rest of the server source under
the NodeNext/tsx setup).import assert from "node:assert/strict";
import { afterEach, mock, test } from "node:test";
import { installBundle, loadInstalledConfig } from "./bundleLoader.ts";
test("loads an installed bundle config", () => {
const config = loadInstalledConfig(/* ... */);
assert.equal(config.name, "research-assistant");
});
Use node:assert/strict:
assert.equal(actual, expected);
assert.deepEqual(obj, { id: "abc" });
assert.ok(value);
assert.throws(() => parse(bad));
await assert.rejects(promise);
Use the runner's built-in mock from node:test (no vi/jest):
import { mock, afterEach } from "node:test";
const fn = mock.fn();
const spy = mock.method(obj, "method");
afterEach(() => {
mock.reset();
});
Existing tests favor real, deterministic fixtures over elaborate mock graphs — e.g. building a
temp directory with mkdtempSync/tmpdir, zipping a real example bundle with fflate, and
asserting on the result. Prefer driving the unit under test with realistic inputs and a fake at the
process/IO boundary (see pi/piAgentManager.test.ts, which drives a FakeChild EventEmitter
instead of spawning a real process) rather than mocking every collaborator.
Persistence is Drizzle + SQLite. When testing store code, use a throwaway/in-memory database and apply migrations rather than mutating a real DB file.