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

推荐订阅源

Martin Fowler
Martin Fowler
有赞技术团队
有赞技术团队
博客园_首页
H
Help Net Security
GbyAI
GbyAI
aimingoo的专栏
aimingoo的专栏
V
Visual Studio Blog
The Cloudflare Blog
腾讯CDC
Jina AI
Jina AI
Last Week in AI
Last Week in AI
月光博客
月光博客
博客园 - 叶小钗
Google DeepMind News
Google DeepMind News
B
Blog RSS Feed
Blog — PlanetScale
Blog — PlanetScale
人人都是产品经理
人人都是产品经理
Engineering at Meta
Engineering at Meta
Y
Y Combinator Blog
Hugging Face - Blog
Hugging Face - Blog
博客园 - 聂微东
爱范儿
爱范儿
N
Netflix TechBlog - Medium
F
Fortinet All Blogs

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: guard infra helper assertions · openclaw/openclaw@1...
steipete · 2026-05-12 · via Recent Commits to openclaw:main
Original file line numberDiff line numberDiff line change

@@ -33,8 +33,10 @@ function collectMatching<T, U>(

3333
3434

function findBeaconByInstance(beacons: readonly BeaconRecord[], instanceName: string) {

3535

const beacon = beacons.find((item) => item.instanceName === instanceName);

36-

expect(beacon).toBeDefined();

37-

return beacon as BeaconRecord;

36+

if (!beacon) {

37+

throw new Error(`Expected beacon ${instanceName}`);

38+

}

39+

return beacon;

3840

}

3941
4042

describe("bonjour-discovery", () => {

Original file line numberDiff line numberDiff line change

@@ -27,7 +27,9 @@ async function expectPathMissing(targetPath: string): Promise<void> {

2727

} catch (error) {

2828

statError = error;

2929

}

30-

expect(statError).toBeDefined();

30+

if (statError === undefined) {

31+

throw new Error(`Expected ${targetPath} to be missing`);

32+

}

3133

expect((statError as { code?: unknown }).code).toBe("ENOENT");

3234

}

3335
Original file line numberDiff line numberDiff line change

@@ -143,8 +143,10 @@ function expectRisk(

143143

const risk = risks.find((candidate) => riskMatches(candidate, fields)) as

144144

| Record<string, unknown>

145145

| undefined;

146-

expect(risk).toBeDefined();

147-

return risk ?? {};

146+

if (!risk) {

147+

throw new Error(`Expected risk ${JSON.stringify(fields)}`);

148+

}

149+

return risk;

148150

}

149151
150152

afterEach(() => {

Original file line numberDiff line numberDiff line change

@@ -26,7 +26,9 @@ afterEach(async () => {

2626
2727

async function expectRejectCode(promise: Promise<unknown>, expected: string | RegExp) {

2828

const err = await promise.catch((caught: unknown) => caught);

29-

expect(err).toBeDefined();

29+

if (err === undefined) {

30+

throw new Error("Expected promise to reject");

31+

}

3032

const code = (err as NodeJS.ErrnoException).code;

3133

if (typeof expected === "string") {

3234

expect(code).toBe(expected);

Original file line numberDiff line numberDiff line change

@@ -26,8 +26,10 @@ function requireRecord(value: unknown, label: string): Record<string, unknown> {

2626

function spawnCall(mock: unknown, callIndex: number) {

2727

const calls = (mock as { mock?: { calls?: Array<Array<unknown>> } }).mock?.calls ?? [];

2828

const call = calls.at(callIndex);

29-

expect(call, `spawn call ${callIndex + 1}`).toBeDefined();

30-

return call as Array<unknown>;

29+

if (!call) {

30+

throw new Error(`Expected spawn call ${callIndex + 1}`);

31+

}

32+

return call;

3133

}

3234
3335

function expectSpawn(mock: unknown, callIndex: number, command: string, args: Array<unknown>) {

Original file line numberDiff line numberDiff line change

@@ -65,9 +65,11 @@ describe("runHeartbeatOnce commitments", () => {

6565

commitment: CommitmentRecord | undefined,

6666

expected: Partial<CommitmentRecord>,

6767

) {

68-

expect(commitment).toBeDefined();

68+

if (!commitment) {

69+

throw new Error("Expected heartbeat commitment");

70+

}

6971

for (const [key, value] of Object.entries(expected)) {

70-

expect(commitment?.[key as keyof CommitmentRecord]).toEqual(value);

72+

expect(commitment[key as keyof CommitmentRecord]).toEqual(value);

7173

}

7274

}

7375
Original file line numberDiff line numberDiff line change

@@ -64,8 +64,10 @@ describe("startHeartbeatRunner", () => {

6464
6565

function getRunCall(runSpy: MockRunOnce, callIndex: number) {

6666

const call = runSpy.mock.calls[callIndex];

67-

expect(call).toBeDefined();

68-

const options = call?.[0];

67+

if (!call) {

68+

throw new Error(`Expected heartbeat run call ${callIndex}`);

69+

}

70+

const options = call[0];

6971

expect(typeof options).toBe("object");

7072

expect(options).not.toBeNull();

7173

return options as Record<string, unknown>;

@@ -93,9 +95,11 @@ describe("startHeartbeatRunner", () => {

9395

.slice(params.startIndex ?? 0)

9496

.map((entry) => entry[0] as { agentId?: string; heartbeat?: { every?: string } })

9597

.find((options) => options.agentId === params.agentId);

96-

expect(call).toBeDefined();

98+

if (!call) {

99+

throw new Error(`Expected heartbeat run call for ${params.agentId}`);

100+

}

97101

if (params.expectedHeartbeatEvery) {

98-

expect(call?.heartbeat?.every).toBe(params.expectedHeartbeatEvery);

102+

expect(call.heartbeat?.every).toBe(params.expectedHeartbeatEvery);

99103

}

100104

}

101105
Original file line numberDiff line numberDiff line change

@@ -172,7 +172,9 @@ describe("json-file helpers", () => {

172172

} catch (error) {

173173

saveError = error;

174174

}

175-

expect(saveError).toBeDefined();

175+

if (saveError === undefined) {

176+

throw new Error("Expected saveJsonFile to fail");

177+

}

176178

expect((saveError as { code?: unknown }).code).toBe("ENOENT");

177179

expect(fs.existsSync(missingTargetDir)).toBe(false);

178180

expect(fs.lstatSync(linkPath).isSymbolicLink()).toBe(true);

Original file line numberDiff line numberDiff line change

@@ -32,7 +32,9 @@ function expectExecCall(

3232

options?: Record<string, unknown>,

3333

) {

3434

const call = exec.mock.calls[callNumber - 1];

35-

expect(call, `call ${callNumber}`).toBeDefined();

35+

if (!call) {

36+

throw new Error(`Expected exec call ${callNumber}`);

37+

}

3638

expect(call[0]).toBe(command);

3739

expect(call[1]).toEqual(args);

3840

if (options) {