惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

S
SegmentFault 最新的问题
Jina AI
Jina AI
罗磊的独立博客
V
Visual Studio Blog
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
J
Java Code Geeks
U
Unit 42
Microsoft Azure Blog
Microsoft Azure Blog
B
Blog RSS Feed
爱范儿
爱范儿
酷 壳 – CoolShell
酷 壳 – CoolShell
Last Week in AI
Last Week in AI
T
The Blog of Author Tim Ferriss
腾讯CDC
Hugging Face - Blog
Hugging Face - Blog
T
Tailwind CSS Blog
让小产品的独立变现更简单 - ezindie.com
让小产品的独立变现更简单 - ezindie.com
I
InfoQ
月光博客
月光博客
博客园_首页
Vercel News
Vercel News
P
Proofpoint News Feed
GbyAI
GbyAI
Y
Y Combinator Blog

Recent Commits to openclaw:main

test: merge chat side-result checks · openclaw/openclaw@ddd2c2a test: merge cron history checks · openclaw/openclaw@f7eb746 test: merge responsive navigation shell checks · openclaw/openclaw@c2e4b47 docs(changelog): add codex oauth fixes · openclaw/openclaw@628e6cd test: merge navigation routing cases · openclaw/openclaw@5d8cecb Tests: mock channel registry bundled fallback · openclaw/openclaw@2b08233 Secrets: avoid broad web search discovery for single plugin config · openclaw/openclaw@a464f59 test: merge config view browser checks · openclaw/openclaw@20cf511 fix(status): align oauth health with runtime · openclaw/openclaw@eed7116 feat: add macOS screen snapshots for monitor preview (#67954) thanks … · openclaw/openclaw@f377db1 fix: report shared auth scopes in hello-ok (#67810) thanks @BunsDev · openclaw/openclaw@0b6c39b Auto-reply: avoid eager bundled route fallback · openclaw/openclaw@3ea1bf4 Tests: narrow session binding contract setup · openclaw/openclaw@54e4e16 fix(macOS): enable undo/redo in webchat composer text input (#34962) · openclaw/openclaw@00951dc Tests: speed up channel setup promotion · openclaw/openclaw@82b529a Docs: refresh agent instructions · openclaw/openclaw@5775fe2 fix(auth): serialize OAuth refresh across agents to fix #26322 (#67876) · openclaw/openclaw@8e79080 test: allow ollama public surface boundary test · openclaw/openclaw@7d4f1a6 Docs: add test performance guardrails · openclaw/openclaw@89706d3 Tests: restore context-engine usage proof · openclaw/openclaw@e4c4f95 Tests: slim context engine runtime coverage · openclaw/openclaw@74c198f ci: retry failed custom checkouts · openclaw/openclaw@0ee5baf test: trim duplicate provider auth onboarding cases · openclaw/openclaw@1ffc02e matrix: fix sessions_spawn --thread subagent session spawning (#67643) · openclaw/openclaw@1ce2596 test: reduce auth choice fixture churn · openclaw/openclaw@857b9cd test: mock health status config boundaries · openclaw/openclaw@9d5ab4a test: mock onboard config io boundary · openclaw/openclaw@299694d test: mock legacy state plugin boundaries · openclaw/openclaw@2713089 test: mock channel install boundaries · openclaw/openclaw@b945248 test: mock doctor preview channel boundaries · openclaw/openclaw@b1a3ad4
test(scripts): route plugin fixture commands · openclaw/o...
vincentkoc · 2026-06-21 · via Recent Commits to openclaw:main
1+

// Fixture Plugin Commands tests cover shared E2E plugin fixture writers.

2+

import { spawnSync } from "node:child_process";

3+

import { readFileSync } from "node:fs";

4+

import path from "node:path";

5+

import { afterEach, describe, expect, it } from "vitest";

6+

import { cleanupTempDirs, makeTempDir } from "../helpers/temp-dir.js";

7+8+

const FIXTURE_SCRIPT = "scripts/e2e/lib/fixture.mjs";

9+

const tempDirs: string[] = [];

10+11+

afterEach(() => {

12+

cleanupTempDirs(tempDirs);

13+

});

14+15+

function runFixture(command: string, args: string[]) {

16+

return spawnSync(process.execPath, [FIXTURE_SCRIPT, command, ...args], {

17+

encoding: "utf8",

18+

env: { ...process.env },

19+

});

20+

}

21+22+

function readJson(file: string) {

23+

return JSON.parse(readFileSync(file, "utf8"));

24+

}

25+26+

describe("plugin fixture commands", () => {

27+

it("writes plugin fixtures with manifest and package metadata", () => {

28+

const root = makeTempDir(tempDirs, "openclaw-fixture-plugin-");

29+

const pluginRoot = path.join(root, "demo");

30+31+

const result = runFixture("plugin", [

32+

pluginRoot,

33+

"demo-plugin",

34+

"0.1.0",

35+

"demo.ping",

36+

"Demo Plugin",

37+

]);

38+39+

expect(result.status).toBe(0);

40+

expect(readJson(path.join(pluginRoot, "package.json"))).toMatchObject({

41+

name: "@openclaw/demo-plugin",

42+

version: "0.1.0",

43+

openclaw: { extensions: ["./index.js"] },

44+

});

45+

expect(readJson(path.join(pluginRoot, "openclaw.plugin.json"))).toMatchObject({

46+

id: "demo-plugin",

47+

configSchema: { type: "object", properties: {} },

48+

});

49+

expect(readFileSync(path.join(pluginRoot, "index.js"), "utf8")).toContain("demo.ping");

50+

});

51+52+

it("writes CLI plugin fixtures with local dependency metadata", () => {

53+

const root = makeTempDir(tempDirs, "openclaw-fixture-plugin-cli-");

54+

const pluginRoot = path.join(root, "cli-demo");

55+56+

const result = runFixture("plugin-cli", [

57+

pluginRoot,

58+

"demo-cli",

59+

"0.2.0",

60+

"demo.cli",

61+

"Demo CLI",

62+

"demo-cli",

63+

"demo-cli:pong",

64+

]);

65+66+

expect(result.status).toBe(0);

67+

expect(readJson(path.join(pluginRoot, "package.json"))).toMatchObject({

68+

dependencies: { "is-number": "file:./deps/is-number" },

69+

});

70+

expect(readJson(path.join(pluginRoot, "deps", "is-number", "package.json"))).toMatchObject({

71+

name: "is-number",

72+

version: "7.0.0",

73+

});

74+

const source = readFileSync(path.join(pluginRoot, "index.js"), "utf8");

75+

expect(source).toContain("demo-cli:pong");

76+

expect(source).toContain("registerCli");

77+

});

78+79+

it("rejects plugin fixture commands with missing required args", () => {

80+

const root = makeTempDir(tempDirs, "openclaw-fixture-plugin-missing-");

81+82+

const result = runFixture("plugin", [path.join(root, "missing"), "demo-plugin"]);

83+84+

expect(result.status).not.toBe(0);

85+

expect(result.stderr).toContain("version is required");

86+

});

87+

});