mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-15 18:50:45 +00:00
test: tighten core helper object assertions
This commit is contained in:
@@ -38,10 +38,6 @@ import { createClaudeApiErrorFixture } from "./test-helpers/claude-api-error-fix
|
||||
type ProcessSupervisor = ReturnType<typeof getProcessSupervisor>;
|
||||
type SupervisorSpawnFn = ProcessSupervisor["spawn"];
|
||||
|
||||
async function expectPathMissing(targetPath: string): Promise<void> {
|
||||
await expect(fs.access(targetPath)).rejects.toMatchObject({ code: "ENOENT" });
|
||||
}
|
||||
|
||||
beforeEach(() => {
|
||||
resetAgentEventsForTest();
|
||||
resetClaudeLiveSessionsForTest();
|
||||
|
||||
@@ -7,7 +7,7 @@ import {
|
||||
} from "./inline-eval.js";
|
||||
|
||||
function expectInlineEvalDescription(hit: InterpreterInlineEvalHit | null, expected: string) {
|
||||
expect(hit).toEqual(expect.any(Object));
|
||||
expect(hit).not.toBeNull();
|
||||
if (hit === null) {
|
||||
throw new Error(`Expected inline eval hit for ${expected}`);
|
||||
}
|
||||
|
||||
@@ -12,7 +12,7 @@ import {
|
||||
|
||||
function parseSpecOrThrow(spec: string) {
|
||||
const parsed = parseRegistryNpmSpec(spec);
|
||||
expect(parsed).toEqual(expect.any(Object));
|
||||
expect(parsed).not.toBeNull();
|
||||
if (parsed === null) {
|
||||
throw new Error(`Expected ${spec} to parse`);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user