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

推荐订阅源

博客园_首页
C
Check Point Blog
B
Blog RSS Feed
G
Google Developers Blog
H
Help Net Security
博客园 - Franky
Blog — PlanetScale
Blog — PlanetScale
H
Hackread – Cybersecurity News, Data Breaches, AI and More
量子位
Recent Announcements
Recent Announcements
B
Blog
Cyber Security Advisories - MS-ISAC
Cyber Security Advisories - MS-ISAC
D
DataBreaches.Net
小众软件
小众软件
T
The Blog of Author Tim Ferriss
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
MongoDB | Blog
MongoDB | Blog
Y
Y Combinator Blog
T
Tailwind CSS Blog
J
Java Code Geeks
MyScale Blog
MyScale 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: tighten skills install assertions · openclaw/opencl...
steipete · 2026-05-10 · via Recent Commits to openclaw:main

@@ -163,12 +163,10 @@ describe("installSkill code safety scanning", () => {

163163164164

expect(result.ok).toBe(false);

165165

expect(result.message).toContain('Skill "danger-skill" installation blocked');

166-

expect(result.warnings ?? []).toEqual(

167-

expect.arrayContaining([

168-

expect.stringContaining("dangerous code patterns"),

169-

expect.stringContaining("runner.js:1"),

170-

]),

171-

);

166+

expect(

167+

(result.warnings ?? []).some((warning) => warning.includes("dangerous code patterns")),

168+

).toBe(true);

169+

expect((result.warnings ?? []).some((warning) => warning.includes("runner.js:1"))).toBe(true);

172170

expect(runCommandWithTimeoutMock).not.toHaveBeenCalled();

173171

});

174172

});

@@ -211,10 +209,8 @@ describe("installSkill code safety scanning", () => {

211209

const call = runCommandWithTimeoutMock.mock.calls.at(-1);

212210

expect(call?.[0]).toEqual(["npm", "install", "-g", "--ignore-scripts", "example-package"]);

213211

const options = call?.[1] as { env?: NodeJS.ProcessEnv };

214-

expect(options.env).toMatchObject({

215-

NPM_CONFIG_PREFIX: npmPrefix,

216-

npm_config_prefix: npmPrefix,

217-

});

212+

expect(options.env?.NPM_CONFIG_PREFIX).toBe(npmPrefix);

213+

expect(options.env?.npm_config_prefix).toBe(npmPrefix);

218214

expect(options.env).not.toHaveProperty("PATH");

219215

const stat = await fs.stat(npmPrefix);

220216

expect(stat.isDirectory()).toBe(true);

@@ -291,28 +287,35 @@ describe("installSkill code safety scanning", () => {

291287292288

expect(result.ok).toBe(true);

293289

expect(handler).toHaveBeenCalledTimes(1);

294-

expect(handler.mock.calls[0]?.[0]).toMatchObject({

295-

targetName: "policy-skill",

296-

targetType: "skill",

297-

origin: "openclaw-workspace",

298-

sourcePath: expect.stringContaining("policy-skill"),

299-

sourcePathKind: "directory",

300-

request: {

301-

kind: "skill-install",

302-

mode: "install",

303-

},

304-

builtinScan: {

305-

status: "ok",

306-

findings: [],

307-

},

308-

skill: {

309-

installId: "deps",

310-

installSpec: expect.objectContaining({

311-

kind: "node",

312-

package: "example-package",

313-

}),

314-

},

290+

const payload = handler.mock.calls[0]?.[0] as

291+

| {

292+

targetName?: string;

293+

targetType?: string;

294+

origin?: string;

295+

sourcePath?: string;

296+

sourcePathKind?: string;

297+

request?: { kind?: string; mode?: string };

298+

builtinScan?: { status?: string; findings?: unknown[] };

299+

skill?: {

300+

installId?: string;

301+

installSpec?: { kind?: string; package?: string };

302+

};

303+

}

304+

| undefined;

305+

expect(payload?.targetName).toBe("policy-skill");

306+

expect(payload?.targetType).toBe("skill");

307+

expect(payload?.origin).toBe("openclaw-workspace");

308+

expect(payload?.sourcePath).toContain("policy-skill");

309+

expect(payload?.sourcePathKind).toBe("directory");

310+

expect(payload?.request).toEqual({

311+

kind: "skill-install",

312+

mode: "install",

315313

});

314+

expect(payload?.builtinScan?.status).toBe("ok");

315+

expect(payload?.builtinScan?.findings).toEqual([]);

316+

expect(payload?.skill?.installId).toBe("deps");

317+

expect(payload?.skill?.installSpec?.kind).toBe("node");

318+

expect(payload?.skill?.installSpec?.package).toBe("example-package");

316319

expect(handler.mock.calls[0]?.[1]).toEqual({

317320

origin: "openclaw-workspace",

318321

targetType: "skill",