Skip to content

Commit 29f7469

Browse files
ersinkocclaude
andcommitted
fix(gateway): scope assertion to check only injection-related log messages
The test "does not log when no memories or goals are injected" was checking mockLogInfo.not.toHaveBeenCalled() — too broad since mockLogInfo intercepts all getLog().info() calls in the gateway, including infrastructure logs (PostgreSQL, Schema init) that fire during test execution. Now checks: mockLogInfo.not.toHaveBeenCalledWith(expect.stringContaining('Injected')) This correctly verifies the middleware doesn't log its own injection message while allowing unrelated infrastructure logs to pass. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
1 parent ba2841f commit 29f7469

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

packages/gateway/src/services/middleware/pipeline-middleware.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1157,7 +1157,7 @@ describe('Pipeline Middleware', () => {
11571157

11581158
await middleware(message, ctx, next);
11591159

1160-
expect(mockLogInfo).not.toHaveBeenCalled();
1160+
expect(mockLogInfo).not.toHaveBeenCalledWith(expect.stringContaining('Injected'));
11611161
});
11621162

11631163
it('serves subsequent calls from cache (skips buildEnhancedSystemPrompt)', async () => {

0 commit comments

Comments
 (0)