mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-19 18:14:44 +00:00
test: guard cli null helpers
This commit is contained in:
@@ -51,8 +51,9 @@ type MockCalls = {
|
||||
};
|
||||
|
||||
function requireRecord(value: unknown, label: string): Record<string, unknown> {
|
||||
expect(typeof value, label).toBe("object");
|
||||
expect(value, label).not.toBeNull();
|
||||
if (!value || typeof value !== "object") {
|
||||
throw new Error(`expected ${label}`);
|
||||
}
|
||||
return value as Record<string, unknown>;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user